1. Home
  2. Data Science
  3. NumPy
  4. What does the np.full() function do in NumPy?

Added 25 Feb 2024

What does the np.full() function do in NumPy?

  1. Creates an array filled with a specified value Correct answer
  2. Creates an array filled with zeros
  3. Creates an array filled with ones
  4. Creates an array filled with random values

Correct answer

A. Creates an array filled with a specified value

16 views

MCQSEXAM

Explanation

The np.full() function generates an array filled with a specified scalar value. It is useful for initializing arrays with a constant value across all elements.

Doubts & discussion

Not sure why the answer is A? 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