From: Sebastian H. <ha...@ms...> - 2006-08-24 21:05:40
|
Hi, I noticed in numpy/numarray/_capi.c: NA_NewAllFromBuffer() a) the original numarray function could create arrays of any (ndim) shape, while PyArray_FromBuffer() looks to me that the returned array is always 1D. b) in the code part <selected lines from code> npy_intp size = dtype->elsize; for ... size *= self->dimensions[i]; PyArray_FromBuffer(bufferObject, dtype, size, byteoffset); </selected lines from code> Is "size" here a muplitple of the itemsize !? I think I got a crashed (my code) that I fixed when I set size to (the equivalent of) N.prod(array.shape) Cheers, Sebastian Haase |