Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #99852 > unrolled thread

Re: 4D arrays

Started byManolo Martínez <manolo@austrohungaro.com>
First post2015-12-02 10:17 +0100
Last post2015-12-02 10:17 +0100
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: 4D arrays Manolo Martínez <manolo@austrohungaro.com> - 2015-12-02 10:17 +0100

#99852 — Re: 4D arrays

FromManolo Martínez <manolo@austrohungaro.com>
Date2015-12-02 10:17 +0100
SubjectRe: 4D arrays
Message-ID<mailman.105.1449048026.14615.python-list@python.org>
On 12/01/15 at 06:47pm, Peter Otten wrote:
> Extract 2D arrays:
> 
> >>> a[:,2,3]
> array([[ 55,  56,  57,  58,  59],
>        [115, 116, 117, 118, 119]])
> >>> a[1,:,2]
> array([[ 70,  71,  72,  73,  74],
>        [ 90,  91,  92,  93,  94],
>        [110, 111, 112, 113, 114]])

The first one is equivalent to a[:, 2, 3, :], which is perhaps clearer
in this context: you are singling out row 2 in axis 1, and row 3 in axis
2, and taking everything from axes 0 and 3.

Mutatis mutandis with the second example and a[1, :, 2, :], which is
different from a[1, :, :, 2], etc.

Manolo

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web