I have a list of tuples which I want to convert to a Series.
return array2
[(0, 0.07142857142857142),
(0, 0.07142857142857142),
(1, 0.08333333333333333),
(1, 0.3333333333333333),
(1, 0.3333333333333333),
(1, 0.08333333333333333),
(3, 0.058823529411764705),
(3, 0.058823529411764705)]
I attempt to do this by converting the list to a dictionary and then to a Series:
a = pd.Series(dict(array2))
The resulting Series however, doesn't behave as I need it to. It seems to drop key:value
pairs (possibly arbitrarily?)
E.g.
return a
0 0.071429
1 0.083333
3 0.058824
How would I obtain a series without dropping any key value pairs?