TypeError: astype() got an unexpected keyword argument 'casting'
Analysis:
cd ~/.local/lib/pypy2.7/site-packages/numpy
grep -r "def astype" *
lib/user_array.py: def astype(self, typecode):
ma/core.py: def astype(self, newtype):
Conclusion:
edit line 14 of
.local/lib/pypy2.7/site-packages/numpy/core/multiarray.py
to change:
src = src.astype(dst.dtype, casting=casting)
into:
src = src.astype(dst.dtype)
Comments (4)
-
reporter -
- changed status to invalid
the casting keyword is supported on PyPy 2.6.0, if you choose to use an earlier PyPy you must use a version of this repo before commit 0208abe, which is marked for PyPy 2.6.0
-
reporter Then shouldn't lib/user_array.py and ma/core.py also support the casting keyword? Or did I run the grep mentioned above in a wrong branch when I installed numpy through
git clone https://bitbucket.org/pypy/numpy.git
? -
We branched off of upstream numpy. As far as I can tell, upstream numpy does not support the casting keyword in astype() in the files you noted, so pypy's numpy simply copies that behaviour
- Log in to comment
See https://bitbucket.org/kevin-keraudren/numpy/commits/57b235218f763f9ac2af3bf403e9f8f0775300fc for patch