[Numpy-discussion] Generically Creating Views of Equal Dimensions

Alexander Michael lxander.m@gmail....
Tue Apr 15 15:45:01 CDT 2008


On Tue, Apr 15, 2008 at 3:38 PM, Robert Kern <robert.kern@gmail.com> wrote:
> On Tue, Apr 15, 2008 at 9:54 AM, Alexander Michael <lxander.m@gmail.com> wrote:
>  > Is there an already existing method to create views that add as many
>  >  dimensions as required to bring a collection of arrays to the same
>  >  dimensionality by adding the appropriate number of numpy.newaxis's to
>  >  the ends? For example:
>
>  The usual broadcasting rule goes the other way; newaxis's are
>  *prepended* to the beginning of the shape. I wouldn't put a function
>  into numpy to do something the opposite of that convention and risk
>  confusing people.

Ah, I see. If my convention was the transpose of what it currently is,
I wouldn't
need to do anything.

Thanks!
Alex


More information about the Numpy-discussion mailing list