Bird
0
0

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:
  1. Step 1: Understand C_CONTIGUOUS

    It means the array elements are stored in a single continuous block of memory in row-major order.
  2. 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.
  3. Final Answer:

    Elements are stored sequentially in memory row-wise -> Option A
  4. 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

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More NumPy Quizzes