[Numpy-discussion] PyArray_PutTo Question

Mark Janikas mjanikas at esri.com
Fri Jul 5 17:48:42 EDT 2013


Hi All,

I am a bit new to the NumPy C-API and I am having a hard time with placing results into output arrays... I am using PyArray_TakeFrom to grab an input dimension of data, then do a calculation, then I want to pack it back to the output... yet the PutTo function does not have an axis argument like the TakeFrom does... I am grabbing by column in a two-dimensional array and I would like to pack it that way.  I know that I can build the result in reverse and pack the columns into rows and then reshape the output... but I am wondering why the PutTo does not behave exactly like the take-from does?... The python implementation "numpy.put" also does not have the axis... so I guess I can see the one-to-one reason for the omission.  However, is building in reverse and reshaping the normal way to pack by column?

Thanks much!

MJ
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20130705/a10703c0/attachment.html>


More information about the NumPy-Discussion mailing list