[Numpy-discussion] ndarray.fill and ma.array.filled

Travis Oliphant oliphant at ee.byu.edu
Wed Mar 22 17:20:19 CST 2006


Tim Hochberg wrote:

>>
>> It seems to me that any function or method that returns an array from 
>> an array should be perfectly consistent and explicit about whether it 
>> makes a copy or not.  Sometimes the filled method *needs* to return a 
>> copy; therefore it should *always* return a copy, regardless of the 
>> presence or state of masking. Hence I think the filled method of ma 
>> needs to be changed in this way also.
>
>
> +1
>
> (mumble mumble reshape mumble)


Tim makes a good point here.  Should the reshape method be fixed to 
always return a copy?  The semantics a.shape = (...) could still be used 
to re-shape contiguous arrays where possible.  

However, whether or not reshape returns a copy is consistent (but 
perhaps not explicitly explained).

We will still have .ravel() which sometimes copies and sometimes doesn't.

-Travis





More information about the Numpy-discussion mailing list