Use numpy arange method to create array with sequence of numbers.

In the below example we create an array of first 10 whole numbers.

Code to use Numpy Arange

# Imports
import numpy as np

# Let's build the array
np.arange(11)
array([ 0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10])

That's how we use Numpy Arange

That’s all for this mini tutorial. To sum it up, we learned how to use numpy’s method “arange” to generate array of numbers. 

Hope it was easy, cool and simple to follow. Now it’s on you.

Leave a Reply

Your email address will not be published. Required fields are marked *