Bird
0
0

Which numpy array attribute indicates if the array's data is stored contiguously in memory?

easy📝 Conceptual Q2 of 15
NumPy - Fundamentals
Which numpy array attribute indicates if the array's data is stored contiguously in memory?
Adtype
Bshape
Cflags.c_contiguous
Dndim
Step-by-Step Solution
Solution:
  1. Step 1: Recall numpy array attributes

    The flags attribute contains memory layout info.
  2. Step 2: Identify correct flag

    c_contiguous is True if array is stored in contiguous row-major order.
  3. Final Answer:

    flags.c_contiguous -> Option C
  4. Quick Check:

    flags.c_contiguous shows contiguous memory [OK]
Quick Trick: Use flags.c_contiguous to check memory layout [OK]
Common Mistakes:
  • Confusing shape or dtype with memory layout
  • Using ndim which only gives number of dimensions

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More NumPy Quizzes