Median calling ndarray.partition: AttributeError
Issue #12
resolved
Calling the median over an ndarray raises an AttributeError:
>>>> import numpy as np
>>>> foo = np.zeros((1,5))
>>>> np.median(foo)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/ester/PhD/pypy2/site-packages/numpy/lib/function_base.py", line 2703, in median
part = partition(a, (sz - 1) // 2, axis=axis)
File "/home/ester/PhD/pypy2/site-packages/numpy/core/fromnumeric.py", line 619, in partition
a.partition(kth, axis=axis, kind=kind, order=order)
AttributeError: 'numpy.ndarray' object has no attribute 'partition'
>>>> np.__version__
'1.8.1'
Comments (5)
-
-
I've hit the same issue (np.version 1.10.0). I tried using overwrite_input=True just in case it helped, but it doesn't.
It doesn't feel like this should be a hard problem to fix, but I know nothing about numpy/pypy so don't know where to look. Any hints?
-
I started thinking about this a while ago, and put some analysis here
https://gist.github.com/mattip/ab34268b049b859554ad
Any help would be wonderful
-
should work now
-
- changed status to resolved
fixed in af36393
- Log in to comment
The same error with numpy.percentile(..)