numpy.logspace()
It creates an array by using the evenly separated numbers on a log scale.
Syntax
Parameters
It accepts the following parameters.
- start: It represents the starting value of the interval in the base.
- stop: It represents the stopping value of the interval in the base.
- num: The number of values between the range.
- endpoint: It is a boolean-type value. It makes the value represented by stop as the last value of the interval.
- base: It represents the base of the log space.
- dtype: It represents the data type of the array items.
Return
An array within the specified range is returned.
Example 1
- import numpy as np
- arr = np.logspace(10, 20, num = 5, endpoint = True)
- print("The array over the given range is ",arr)