Skip to content

Instantly share code, notes, and snippets.

@IndhumathyChelliah
Created January 19, 2021 06:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save IndhumathyChelliah/0ba2c0fad3f22b30ebb03d8d89c9a217 to your computer and use it in GitHub Desktop.
Save IndhumathyChelliah/0ba2c0fad3f22b30ebb03d8d89c9a217 to your computer and use it in GitHub Desktop.
import numpy as np
a1=np.arange(1,6)
print (a1)
#Output:[1 2 3 4 5]
#giving step size
a2=np.arange(2,10,2)
print (a2)
#Output:[2 4 6 8]
#Step can be a float number
a3=np.arange(2,6,0.5)
print (a3)
#Output:[2. 2.5 3. 3.5 4. 4.5 5. 5.5]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment