[Numpy-discussion] adding 'order=' keyword arg to ravel and others

Mark Wiebe mwwiebe@gmail....
Wed Oct 27 12:33:43 CDT 2010


On Wed, Oct 27, 2010 at 2:36 AM, Pauli Virtanen <pav@iki.fi> wrote:

> There is the following problem:
>
> >>> import numpy as np
> >>> x=np.arange(9).reshape(3,3)
> >>> x.T.flatten()
> array([0, 3, 6, 1, 4, 7, 2, 5, 8])
> >>> x.T.flatten(order=None)
> array([0, 1, 2, 3, 4, 5, 6, 7, 8])
>
> PyArray_OrderConverter interprets `None` as "A". However, this problem is
> already there with `reshape`, so this patch looks good to me -- fixing
> OrderConverter is a separate job.


The name 'A' for 'Any' doesn't seem right to me either -- 'P' for 'Preserve'
or 'K' for 'Keep' would make more sense to me.

-Mark
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/numpy-discussion/attachments/20101027/cfecf30d/attachment.html 


More information about the NumPy-Discussion mailing list