Which NumPy function creates an array of zeros with a given shape?

Data Science with Python Easy

Data Science with Python — Easy

Which NumPy function creates an array of zeros with a given shape?

Key points

  • np.zeros() is used to generate an array filled with zeros
  • np.empty() creates an array without initializing its values
  • np.none() and np.blank() are not valid NumPy functions for this purpose

Ready to go further?

Related questions