-
-
Notifications
You must be signed in to change notification settings - Fork 11.9k
Closed
Description
When using np.newaxis, the array flags of the new array are set to say that the array is not C or Fortran contiguous, even when it should be.
For example:
import numpy as np
from numpy.random import rand
# Make an array that is C contiguous and F contiguous
A = rand(10)
A2 = A[...,np.newaxis]
print A2.flags
The flags are shown to be
C_CONTIGUOUS : False
F_CONTIGUOUS : False
OWNDATA : False
WRITEABLE : True
ALIGNED : True
UPDATEIFCOPY : False
Even though the actual memory layout of the array is both C and Fortran contiguous.
I can verify that this behavior appears on Linux and Windows installations of NumPy 1.8.
Metadata
Metadata
Assignees
Labels
No labels