[pypy-issue] [issue919] implement multi-dimention arrays in micronumpy

Peter tracker at bugs.pypy.org
Sun Oct 23 00:33:31 CEST 2011


New submission from Peter <p.j.a.cock at googlemail.com>:

The following should work in any recent release of numpy,

>>> import numpy
>>> two_dim = numpy.array([[1,0],[0,1]])
>>> two_dim
array([[1, 0],
       [0, 1]])
>>> three_dim = numpy.array([[[1,0],[0,1]],[[1,2],[0,1]]])
>>> three_dim
array([[[1, 0],
        [0, 1]],

       [[1, 2],
        [0, 1]]])

However, while one dimensional arrays seem to work, higher dimensions do not:

>>>> two_dim = numpy.array([[1,0],[0,1]])
Traceback (most recent call last):
  File "<console>", line 1, in <module>


>>>> three_dim = numpy.array([[[1,0],[0,1]],[[1,2],[0,1]]])
Traceback (most recent call last):
  File "<console>", line 1, in <module>
TypeError: unsupported operand type for float(): 'list'

Note this also blocks implementing the matrix class, see Issue 918. I filed that 
first because I hit that first (and it didn't occur to me till afterwards to 
check if arrays worked properly).

----------
messages: 3374
nosy: peterjc, pypy-issue
priority: bug
release: 1.6
status: unread
title: implement multi-dimention arrays in micronumpy

________________________________________
PyPy bug tracker <tracker at bugs.pypy.org>
<https://bugs.pypy.org/issue919>
________________________________________


More information about the pypy-issue mailing list