On 28 Oct 2014 16:58, "Alexander Belopolsky" <ndar...@mac.com> wrote:
>
> On Mon, Oct 27, 2014 at 9:41 PM, Yuxiang Wang <yw...@virginia.edu> wrote:
>
>> In my opinion - because they don't do the same thing, especially when
>> you think in terms in lower-level.
>>
>> ndarray.flat returns an iterator; ndarray.flatten() returns a copy;
>> ndarray.ravel() only makes copies when necessary; ndarray.reshape() is
>> more general purpose, even though you can use it to flatten arrays.
>
>
> Out of the four ways, I find x.flat the most confusing.

I too would be curious to know why .flat exists (beyond "it seemed like a
good idea at the time" ;-)). I've always treated it as some weird legacy
thing and ignored it, and this has worked out well for me.

Is there any real problem where .flat is really the best solution? Should
we deprecate it, or at least warn people off from it officially?

-n
_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to