What is the main advantage of using NumPy arrays over regular Python lists for data analysis?
Correct Answer: C
The primary advantage of NumPy arrays in data analysis is their support for fast, vectorized computation over whole collections of numeric data. A NumPy `ndarray` stores elements in a contiguous memory block with a single, fixed data type, enabling efficient low-level operations implemented in optimized C/Fortran code. As a result, expressions like `arr + 5`, `arr * arr`, or `np.mean(arr)` operate over the entire array without explicit Python loops. This style is commonly called **vectorization**, and it is a central theme in scientific computing textbooks because it is both clearer to read and significantly faster for large datasets.
Option A describes a property of Python lists, not NumPy arrays. Python lists can mix types freely, but this flexibility comes with overhead. Option B is true-NumPy arrays typically hold a single dtype-but it is not the main advantage; it is more of an implementation feature that enables speed and memory efficiency.
Option D is not a defining advantage; both lists and arrays can be concatenated, and NumPy provides dedicated functions such as `np.concatenate`, but concatenation is not the core reason NumPy dominates data analysis workflows.
# Because NumPy operations are applied element-wise across entire arrays and can leverage CPU vector instructions and efficient memory access patterns, they form the foundation for higher-level tools like pandas, SciPy, and many machine learning libraries. This is why the best answer is that NumPy arrays can perform calculations over entire collections of values.