1. Home
  2. Data Science
  3. NumPy
  4. What is the main advantage of using NumPy arrays over…

Added 24 Feb 2024

What is the main advantage of using NumPy arrays over Python lists?

  1. NumPy arrays are resizable
  2. NumPy arrays can hold elements of different data types
  3. NumPy arrays support vectorized operations Correct answer
  4. NumPy arrays have built-in sorting functions

Correct answer

C. NumPy arrays support vectorized operations

11 views

MCQSEXAM

Explanation

NumPy arrays support vectorised operations. An expression such as a * 2 or a + b is applied to every element at once in compiled C code, with no Python loop.

Arrays are in fact fixed in size and hold a single data type — the opposite of the first two options — and that is the source of their speed.

Want more practice? Try the full set of Data Science MCQs on MCQsExam.com.

Doubts & discussion

Not sure why the answer is C? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More NumPy MCQs

Practise all NumPy MCQs

Similar MCQs