T Same as self.transpose(), except that self is returned if self.ndim < 2.
data Python buffer object pointing to the start of the array’s data.
dtype Data-type of the array’s elements.
**flags** Information about the memory layout of the array.
flat A 1-D iterator over the array.
imag The imaginary part of the array.
real The real part of the array.
size Number of elements in the array.
itemsize Length of one array element in bytes.
nbytes Total bytes consumed by the elements of the array.
ndim Number of array dimensions.
shape Tuple of array dimensions.
strides Tuple of bytes to step in each dimension when traversing an array.
ctypes An object to simplify the interaction of the array with the ctypes module.
base Base object if memory is from some other object.
The flags object can be accessed dictionary-like (as in a.flags['WRITEABLE']),
or by using lowercased attribute names (as in a.flags.writeable). Short flag
names are only supported in dictionary access.
Only the UPDATEIFCOPY, WRITEABLE, and ALIGNED flags can be changed by
the user, via direct assignment to the attribute or dictionary entry,
or by calling ndarray.setflags.
The array flags cannot be set arbitrarily:
UPDATEIFCOPY can only be set False.
ALIGNED can only be set True if the data is truly aligned.
WRITEABLE can only be set True if the array owns its own memory
or the ultimate owner of the memory exposes a writeable buffer
interface or is a string.
Arrays can be both C-style and Fortran-style contiguous simultaneously.
This is clear for 1-dimensional arrays, but can also be true for higher
dimensional arrays.
Even for contiguous arrays a stride for a given dimension
arr.strides[dim] may be arbitrary if arr.shape[dim]==1
or the array has no elements.
It does not generally hold that self.strides[-1]==self.itemsize
for C-style contiguous arrays or self.strides[0]==self.itemsize for
Fortran-style contiguous arrays is true.
Attributes
C_CONTIGUOUS (C)
The data is in a single, C-style contiguous segment.
F_CONTIGUOUS (F)
The data is in a single, Fortran-style contiguous segment.
OWNDATA (O)
The array owns the memory it uses or borrows it from another object.
WRITEABLE (W)
The data area can be written to. Setting this to False locks the data, making it read-only. A view (slice, etc.) inherits WRITEABLE from its base array at creation time, but a view of a writeable array may be subsequently locked while the base array remains writeable. (The opposite is not true, in that a view of a locked array may not be made writeable. However, currently, locking a base object does not lock any views that already reference it, so under that circumstance it is possible to alter the contents of a locked array via a previously created writeable view onto it.) Attempting to change a non-writeable array raises a RuntimeError exception.
ALIGNED (A)
The data and all elements are aligned appropriately for the hardware.
UPDATEIFCOPY (U)
This array is a copy of some other array. When this array is deallocated, the base array will be updated with the contents of this array.