On Mon, May 28, 2018 at 7:36 PM Eric Wieser <wieser.eric+nu...@gmail.com>
wrote:

> which ensure that it is still well defined (as the identity) on 1d arrays.
>
> This strikes me as a bad idea. There’s already enough confusion from
> beginners that array_1d.T is a no-op. If we introduce a matrix-transpose,
> it should either error on <1d inputs with a useful message, or insert the
> extra dimension. I’d favor the former.
>
To be clear: matrix transpose is an example use-case rather than a serious
proposal in this discussion.

But given that idiomatic NumPy code uses 1D arrays in favor of explicit
row/column vectors with shapes (1,n) and (n,1), I do think it does make
sense for matrix transpose on 1D arrays to be the identity, because matrix
transpose should convert back and forth between row and column vectors
representations.

Certainly, matrix transpose should error on 0d arrays, because it doesn't
make sense to transpose a scalar.
_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion@python.org
https://mail.python.org/mailman/listinfo/numpy-discussion

Reply via email to