[Numpy-discussion] Slicing slower than matrix multiplication?

Jasper van de Gronde th.v.d.gronde@hccnet...
Tue Dec 15 04:48:54 CST 2009


Charles R Harris wrote:
>     Sort of, it's actually (Xi.T*S).T, now that I think of it... I'll see if
>     that is any faster. And if there is a neater way of doing it I'd love to
>     hear about it.
> 
> Xi*S[:,newaxis]

Thanks! (Obviously doesn't matter much in terms of performance, as it's 
only the initialization, but it definitely does make for nicer code.)


More information about the NumPy-Discussion mailing list