[Numpy-discussion] Release of NumPy
Stéfan van der Walt
Wed Apr 16 04:45:02 CDT 2008
On 16/04/2008, Anne Archibald <firstname.lastname@example.org> wrote:
> I don't think of arrays as containers of anything but scalars, so I
> find this whole argument from intuition extremely strange.
I see now for the first time that Matrices can't have dims > 2. Grim.
I do think that ColumnVector and RowVector could be useful in
general; some statements read more clearly, e.g. (for x an (N,)-array)
np.c_[x] # turn x into a column vector
RowVector(x) * ColumnVector(x)
is clearer than
x = np.dot(np.r_[x], np.c_[x])
(which is a pattern I'd expect to find amongst linear algebra users)
The last expression also yields
array() instead of 14!
> My (draconian) suggestion would be to simply raise an exception when a
> matrix is indexed with a scalar. They're inherently two-dimensional;
> if you want a submatrix you should provide both indices (possibly
> including a ":"). If you actually want a subarray, as with an array,
> use ".A".
Your idea isn't that far out -- but I think we can provide the
expected (ndarray-like) behaviour in this case.
> That said, I don't actually use matrices, so I don't get a vote.
Apparently, neither do I :) But I do get to modify
I also changed ProposedEnhancements into a Category page, that
automatically accumulates all WikiPages tagged with
More information about the Numpy-discussion