[Numpy-discussion] C API function to get the shape of an array ?

Soeren Sonnenburg python-ml at nn7.de
Sat Jul 23 09:13:16 EDT 2005


I just want to use NA_get1_Int64 etc but I couldn't find a way to
'cleanly' find out about the size of an array, i.e. I always have to
access raw fields in the PyArrayObject structure like:

PyArrayObject* a;

if (a->nd == 2)
  if (a->dimensions[0] == m &&
      b->dimensions[1] == n)

Is this the intended way ? I hope not...


More information about the NumPy-Discussion mailing list