New submission from Anders Kaseorg <[email protected]>: In CPython, np.array(1)[np.newaxis] returns array([1]). In PyPy, it raises “IndexError: 0-d arrays can't be indexed”.
This also shows up in code like this: a = np.zeros(10) b = np.array([3,4,5]) a[b] = 1 # CPython: a == array([0, 0, 0, 1, 1, 1, 0, 0, 0, 0]) # PyPy: IndexError: 0-d arrays can't be indexed (Is it useful to report bugs in PyPy’s numpy implementation at this stage?) Version info: Python 2.7.3 (0edc9b68247e, Dec 13 2013, 23:00:16) [PyPy 2.3.0-alpha0 with GCC 4.6.3] on linux2 ---------- messages: 6420 nosy: andersk, pypy-issue priority: bug status: unread title: numpy: 0-d arrays should be indexable with np.newaxis ________________________________________ PyPy bug tracker <[email protected]> <https://bugs.pypy.org/issue1659> ________________________________________ _______________________________________________ pypy-issue mailing list [email protected] https://mail.python.org/mailman/listinfo/pypy-issue
