Reputation: 305
In a programming quiz I came accross the flags attribute for numpy arrays in Python and I was wondering was the output all means. After reading https://docs.scipy.org/doc/numpy/reference/generated/numpy.ndarray.flags.html, I don't really understand some of the output. What do C_CONTIGUOUS
, F_CONTIGUOUS
, ALIGNED
and UPDATEIFCOPY
mean, explained without as much jargon as the documentation?
import numpy as np
x=np.array([[3,4],[3,5]])
print(x.flags)
which outputs the following:
C_CONTIGUOUS : True
F_CONTIGUOUS : False
OWNDATA : True
WRITEABLE : True
ALIGNED : True
UPDATEIFCOPY : False
Upvotes: 2
Views: 5776
Reputation: 6528
It gives information about how the array is stored in memory.
C_CONTIGUOUS true means it is stored as c-type in memory.
See the documentation for more on each attribute.
Upvotes: 1