[Python-ideas] Vectorization [was Re: Add list.join() please]

Greg Ewing greg.ewing at canterbury.ac.nz
Sun Feb 3 18:08:08 EST 2019


Ronald Oussoren via Python-ideas wrote:
> 
>> On 3 Feb 2019, at 21:34, David Mertz <mertz at gnosis.cx 
>> <mailto:mertz at gnosis.cx>> wrote:
 >>
>> Using @ both for matrix multiplication and 
> element-wise application could be made to work, but would be very 
> confusing.

The way @ is defined in numpy does actually work for both.
E.g. v1 @ v2 where v1 and v2 are 3-dimensional arrays is
equivalent to multiplying two 1D arrays of 2D matrices
elementwise.

Is this confusing? Maybe, but it's certainly useful.

-- 
Greg


More information about the Python-ideas mailing list