[Numpy-discussion] order flag again
Charles R Harris
charlesr.harris at gmail.com
Mon Mar 27 13:19:02 CST 2006
On 3/27/06, Fernando Perez <Fernando.Perez at colorado.edu> wrote:
> On 01:46 PM Tim Hochberg wrote:
> > As I've mentioned before, I'd like to sweep all of the operations that
> > return a view or a copy into a few asXXXarray functions so that these
> > potentially problematic operations are localized and easily
> +1 on the idea that:
> asXXXarray: functions which take their input and return always an array,
> trying to avoid copies if at all possible. This means that code calling
> functions should treat their returned values strictly as /inputs/, never
> modifying them in place. These functions are provided by numpy strictly
> performance reasons.
How about Tim's example: b = asarray(a).reshape(newshape)
Or something like that.
I think the problem is mixing python list types with arrays. It is
convenient but we get into trouble.
What purpose does ascontiguous serve?
I like being able to tell to users that this kind of
> problem is solved by a unified familiy of functions in the API, with a
> naming convention. There is a need for them, but they are also a bit
> dangerous, so they should be clearly labeled. Painting them all in the
> bright red helps indicate their 'sharp blade' nature.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Numpy-discussion