Creating NumPy Arrays

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

--

--

Tech enthusiastic, life explorer, single, motivator, blogger, writer, software engineer

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Alok Gupta

Tech enthusiastic, life explorer, single, motivator, blogger, writer, software engineer