[Numpy-discussion] Matching 0-d arrays and NumPy scalars
Thu Feb 21 11:24:38 CST 2008
On Feb 21, 2008, at 18:08, Alan G Isaac wrote:
> I do not think anyone has really defended this behavior,
> *but* the reply to me when I suggested that a matrix
> contains arrays and we should see that in its behavior
> was that, no, a matrix is a container of matrices so this is
> what you get.
I can't say much about matrices in NumPy as I never used them, nor
tried to understand them. The example you give looks weird to me.
> So a possible problem with your phrasing of the argument
> (from a non-CS, user point of view)
> is that it fails to address what is actually "contained"
> (as opposed to what you might wish were contained).
Most Python container objects contain arbitrary objects. Arrays are
an exception (the exception being justified by the enormous memory
and performance gains) in that all its elements are necessarily of
identical type. A float64 array is thus a container of float64 values.
BTW, I am not a CS type either, my background is in physics. I see
myself on the "user" side as well.
More information about the Numpy-discussion