← Back to team overview

ffc team mailing list archive

Limitation in NumPy?

 

Does anyone know if there is a limitation in NumPy to 12 axes
for numpy.transpose?

Try the following code:

  import numpy

  n = 13
  shape = n*(1,)
  axes  = range(n)

  A = numpy.zeros(shape)
  A = numpy.transpose(A, axes)

It works for n = 12, but for n = 13 I get

Traceback (most recent call last):
  File "test.py", line 8, in <module>
    A = numpy.transpose(A, axes)
  File "/usr/lib/python2.5/site-packages/numpy/core/fromnumeric.py",
  line 118, in transpose
    return transpose(axes)
ValueError: dimensions too large.

/Anders