Unlike standard Python lists, why are NumPy arrays more memory-efficient and…
2026
Unlike standard Python lists, why are NumPy arrays more memory-efficient and faster for mathematical operations?
- A.
They can store multiple data types (strings, ints, floats) in a single array.
- B.
They are stored in non-contiguous memory locations.
- C.
They are “homogeneously typed”, meaning all elements are of the same data type and stored in contiguous memory.
- D.
They do not support mathematical operations like multiplication or addition.
Attempted by 83 students.
Show answer & explanation
Correct answer: C
NumPy arrays are more memory-efficient and faster because they store elements of the same data type in contiguous blocks of memory. This homogeneous structure allows for optimized memory usage and vectorized operations, unlike Python lists which store pointers to heterogeneous objects scattered in memory.