October 2019
Beginner to intermediate
674 pages
16h 43m
English
The arange function of NumPy functionally resembles Python's range function. Based on a start value, stop value, and step value to increment or decrement subsequent values, the arange function generates a set of numbers. Just like the range function, the start and step arguments are optional here. But unlike range, which generates a list, arange generates an array:
# Creating an array with continuous values from 0 to 5In [44]: np.arange(6)Out [44]: array([0, 1, 2, 3, 4, 5])# Creating an array with numbers from 2 to 12 spaced out at intervals of 3In [45]: np.arange(2, 13, 3)Out [45]: array([ 2, 5, 8, 11])
The linspace function generates an array of linearly spaced samples for a given start point and end point. ...
Read now
Unlock full access