[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 CDT 2005


Hi,

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...

Best,
Soeren





More information about the Numpy-discussion mailing list