[Numpy-discussion] Re: asarray behaviour
Chris Barker
Chris.Barker at noaa.gov
Thu Oct 13 09:58:00 EDT 2005
Colin J. Williams wrote:
> I'm puzzled by this. There is already a matrix class which should
> construct a matrix instance from a list, tuple or array or any subclass
> of array - I haven't tested all of these.
A) I was speaking generically. I haven't made use of any particular
matrix class myself.
B) I assume the standard matrix() constructor always creates a copy of
the data, much like the NumPy array() constructor. In this case, the
discussion was about the behavior of asarray(), which creates a new
array if the argument is not an array, but returns the argument
untouched if it already is an array. I was proposing that a matrix
package (and any other subclass of ndarray) could benefit from a similar
function.
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chris.Barker at noaa.gov
More information about the NumPy-Discussion
mailing list