Is there a function that ensures that the index is unique or that it can only handle this in python itself, converting it to a dict and vice versa, or something like that?
As noted in the comments below: python pandas is a project built on numpy / scipy.
to_dict and back works, but I'm sure it gets slow when you get BIG.
In [24]: a = pandas.Series([1,2,3], index=[1,1,2]) In [25]: a Out[25]: 1 1 1 2 2 3 In [26]: a = a.to_dict() In [27]: a Out[27]: {1: 2, 2: 3} In [28]: a = pandas.Series(a) In [29]: a Out[29]: 1 2 2 3
source share