bug with numpy.roll
Issue #2
resolved
Whenever I try to roll an array with the axis specified, I get a NameError: global name 'prod' is not defined
. The full session looks like:
$ pypy
Python 2.7.3 (87aa9de10f9c, Nov 24 2013, 20:57:21)
[PyPy 2.2.1 with GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.2.79)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
And now for something completely different: ``why there is no "PyPy 1.4
released" in topic any more?''
>>>> import numpy as np
>>>> a = np.arange(10)
>>>> np.roll(a, 1)
array([9, 0, 1, 2, 3, 4, 5, 6, 7, 8])
>>>> a = np.asarray([[1,2,3],[4,5,6]])
>>>> np.roll(a, 1)
array([[6, 1, 2],
[3, 4, 5]])
>>>> np.roll(a, 1, 0)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/Cellar/pypy/2.2.1/libexec/site-packages/numpy/core/numeric.py", line 1294, in roll
res = a.take(indexes, axis)
NameError: global name 'prod' is not defined
>>>> np.__version__
'1.8.0.dev-1f83790'
numpy was installed as per the instructions in http://morepypy.blogspot.com/2013/11/numpy-status-update.html on Jan 16th using commit id 1f837909355b7d79180b8c15f84511b78a652643
Comments (3)
-
-
- changed status to resolved
-
Sorry, newer pypy...
- Log in to comment
Use a newer numpy (nightly), was fixed some time ago.