Creating NumPy Arrays
np.ones()
: It is used to create an array of 1s.np.zeros()
: It is used to create an array of 0s.np.random.randint()
: It is used to create a random array of integers within a particular range.np.random.random()
: It is used to create an array of random numbers.np.arange()
: It is used to create an array with increments of fixed step size.np.linspace()
: It is used to create an array of fixed length.