We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In Python 2, the following code used to work, but no longer in Python 3:
In [6]: x = np.array([1.1, 'a'], dtype=np.object) In [7]: np.unique(x) --------------------------------------------------------------------------- TypeError Traceback (most recent call last) <ipython-input-7-9a478241c930> in <module>() ----> 1 np.unique(x) /Users/tom/Library/Python/3.4/lib/python/site-packages/numpy/lib/arraysetops.py in unique(ar, return_index, return_inverse, return_counts) 193 aux = ar[perm] 194 else: --> 195 ar.sort() 196 aux = ar 197 flag = np.concatenate(([True], aux[1:] != aux[:-1])) TypeError: unorderable types: float() > str()
Is this intended behavior, and if so, are there any suggested alternatives in this situation?
The text was updated successfully, but these errors were encountered:
its not specific to numpy, its normal python3 behaviour for objects:
In [1]: sorted([1.1, u'a']) TypeError: unorderable types: str() < float()
Sorry, something went wrong.
hm we have a pr somewhere that uses hashes for unique of object arrays somewhere ..
hm no just an issue, #641 closing as duplicate
No branches or pull requests
In Python 2, the following code used to work, but no longer in Python 3:
Is this intended behavior, and if so, are there any suggested alternatives in this situation?
The text was updated successfully, but these errors were encountered: