8000 Ndarray transposing when indexing with list past the 2nd axis · Issue #7223 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content
Ndarray transposing when indexing with list past the 2nd axis #7223
Closed
@kitizz

Description

@kitizz

Hiya!

Using:
Numpy version 1.10.2
Python 3.5
Mac OSX 10.10.3

This occurs when:

  • First axis is sliced with a single index, and
  • Any axis past the 2nd axis is indexed with a list

Self contained example:

A = np.zeros((2,3,4))
print(A[0, :, 0:2].shape)  # (3,2) As one would expect
print(A[0, :, [0,1]].shape)  # (2,3) Unexpected

I've inspected the values afterwards to confirm that it's a simple transposition that's occurring (no weird remapping of data). Also occurs for arrays with higher dimensions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0