[Numpy-discussion] ndarray.T2 for 2D transpose

josef.pktd at gmail.com josef.pktd at gmail.com
Fri Apr 8 16:52:04 EDT 2016


On Fri, Apr 8, 2016 at 3:55 PM, Charles R Harris <charlesr.harris at gmail.com>
wrote:

>
>
> On Fri, Apr 8, 2016 at 12:17 PM, Chris Barker <chris.barker at noaa.gov>
> wrote:
>
>> On Fri, Apr 8, 2016 at 9:59 AM, Charles R Harris <
>> charlesr.harris at gmail.com> wrote:
>>
>>> Apropos column/row vectors, I've toyed a bit with the idea of adding a
>>> flag to numpy arrays to indicate that the last index is one or the other,
>>> and maybe neither.
>>>
>>
>> I don't follow this. wouldn't it ony be an issue for 1D arrays, rather
>> than the "last index". Or maybe I'm totally missing the point.
>>
>> But anyway, are (N,1) and (1, N) arrays insufficient for representing
>> column and row vectors for some reason? If not -- then we have a way to
>> express a column or row vector, we just need an easier and more obvious way
>> to create them.
>>
>> *maybe* we could have actual column and row vector classes -- they would
>> BE regular arrays, with (1,N) or (N,1) dimensions, and act the same in
>> every way except their __repr__. and we're provide handy factor functions
>> for them.
>>
>> These were needed to complete the old Matrix class -- which is no longer
>> needed now that we have @ (i.e. a 2D array IS a matrix)
>>
>
> One problem with that approach is that `vrow @ vcol` has dimension 1 x 1,
> which is not a scalar.
>

I think it's not supposed to be a scalar, if @ breaks on scalars

`vrow @ vcol @ a

Josef`



>
> Chuck
>
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion at scipy.org
> https://mail.scipy.org/mailman/listinfo/numpy-discussion
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20160408/15b83604/attachment.html>


More information about the NumPy-Discussion mailing list