[Numpy-discussion] arbitrary number of newaxis

Sasha ndarray at mac.com
Mon Jul 3 07:54:43 CDT 2006

On 7/3/06, Andrew Corrigan <acorriga at gmu.edu> wrote:
> ... Essentially I want to say something like:
> A[:,:,repeat(newaxis, B.ndim)]*B[newaxis,newaxis,...]
> How can I express what I mean, such that it actually works?

>>> A[(slice(None),)*2 + (newaxis,)*B.ndim]

More information about the Numpy-discussion mailing list