In numpy, what characteristic defines a C_CONTIGUOUS array?
easy📝 Conceptual Q1 of 15
NumPy - Fundamentals
In numpy, what characteristic defines a C_CONTIGUOUS array?
AElements are stored sequentially in memory row-wise
BArray elements are stored in random memory locations
CArray is stored in column-major order
DArray has gaps between elements in memory
Step-by-Step Solution
Solution:
Step 1: Understand C_CONTIGUOUS
It means the array elements are stored in a single continuous block of memory in row-major order.
Step 2: Analyze options
Elements are stored sequentially in memory row-wise correctly describes row-wise contiguous storage. Options B, C, and D are incorrect because they describe non-contiguous or different memory layouts.
Final Answer:
Elements are stored sequentially in memory row-wise -> Option A
Quick Check:
Row-major contiguous means sequential memory [OK]
Quick Trick:C_CONTIGUOUS means row-wise sequential memory [OK]
Common Mistakes:
Confusing C_CONTIGUOUS with Fortran order
Assuming non-contiguous arrays are still C_CONTIGUOUS
Master "Fundamentals" in NumPy
9 interactive learning modes - each teaches the same concept differently