Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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