Re: [Numpy-discussion] converting a C bytes array to two dimensional numpy array

2019-07-19 Thread Chris Barker - NOAA Federal
You can also directly build a numpy array from a pointer with the numpy API. And I recommend Cython as an interface to make these things easy. This does mean you’d need to have the numpy lib at build time, .which may be a downside. -CHB Christopher Barker, Ph.D. Oceanographer Emergency Respon

Re: [Numpy-discussion] converting a C bytes array to two dimensional numpy array

2019-07-16 Thread Derek Homeier
On 16 Jul 2019, at 9:30 am, Omry Levy wrote: > > I have a question, regarding conversion of C (unsigned char *) buffer to a > two dimensional numpy array > > this is what i am doing: > 1) I get a C network buffer of unsigned char * let's call it the source > buffer > the size of the source bu

[Numpy-discussion] converting a C bytes array to two dimensional numpy array

2019-07-16 Thread Omry Levy
Hi, I have a question, regarding conversion of C (unsigned char *) buffer to a two dimensional numpy array this is what i am doing: 1) I get a C network buffer of unsigned char * let's call it the source buffer the size of the source buffer is: W * H * 2 bytes 2) I am using PyByteArray_FromSt