Brendan Barnwell
unread,May 18, 2013, 5:02:04 PM5/18/13Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to pyd...@googlegroups.com
It appears that it is not possible to create a Series from a dict whose keys are unorderable. Series.__init__ unconditionally attempts to sort a dict that is passed as the data.
>>> pandas.Series({1j: 1, 2j: 2})
Traceback (most recent call last):
File "<pyshell#33>", line 1, in <module>
pandas.Series({1j: 1, 2j: 2})
File "c:\users\brenbarn\documents\python\extensions\pandas\pandas\core\series.py", line 444, in __new__
index = Index(sorted(data))
TypeError: no ordering relation is defined for complex numbers
Should I raise a ticket for this? It's possible to work around it by passing in the dict values as the data and the keys as the indices, but this is somewhat cumbersome. It would be nice to just have a flag to pass to Series to say "don't try to sort anything".