[Numpy-discussion] Add guaranteed no-copy to array creation and reshape?

Sebastian Berg sebastian at sipsolutions.net
Fri Jan 11 08:58:21 EST 2019


On Fri, 2019-01-11 at 13:57 +1100, Juan Nunez-Iglesias wrote:
> 
> 
> > On 10 Jan 2019, at 6:35 pm, Todd <toddrjen at gmail.com> wrote:
> > 
> > Could this approach be used to deprecate `ravel` and let us just
> > use `flatten`?
> 
> 
> Could we not? `.ravel()` is everywhere and it matches
> `ravel_multi_index` and `unravel_index`.

True, I suppose either of those functions could get such an argument as
well. Just side note `arr.ravel()` is also not quite equivalent to
`arr.reshape(-1)`, since it actually provides some additional
assurances on the result contiguity.

- Sebastian


> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion at python.org
> https://mail.python.org/mailman/listinfo/numpy-discussion
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20190111/94d74abc/attachment.sig>


More information about the NumPy-Discussion mailing list