I have an iterator object then when iterated has its each item attributes out of which the interested in time and value
[(point.time, point.value) for point in control_points]
[(Fraction(-1, 23), Fraction(0, 1)), (Fraction(24, 23), Fraction(100, 1))]
both time and value are Fraction
object
now I have to build a data structure mapped in a way the first tuple is the one with in_time dict and second tuple to out_time dict
({'in_time': "" , 'in_value': ""} , {'out_time': "", 'out_value': ""})
i have also tried in a different way using list somehting like this:
container = [['in_time', 'in_value'] , ['out_time', 'out_value']]
dict(zip([objects for objects in container, [(point.time, point.value) for point in contol_points]]))
Traceback (most recent call last):
File "<console>", line 1, in <module>
ValueError: dictionary update sequence element #0 has length 1; 2 is required
I was hoping somehting like this would be possible: https://stackoverflow.com/a/33737067/9567948