JustPaste.it

numpy.logspace() in Python - TAE

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.

numpy.logspace()

It creates an array by using the evenly separated numbers on a log scale.

Syntax

  1. numpy.logspace(start, stop, num, endpoint, base, dtype)  

Parameters

It accepts the following parameters.

  1. start: It represents the starting value of the interval in the base.
  2. stop: It represents the stopping value of the interval in the base.
  3. num: The number of values between the range.
  4. endpoint: It is a boolean-type value. It makes the value represented by stop as the last value of the interval.
  5. base: It represents the base of the log space.
  6. dtype: It represents the data type of the array items.

numpylogspaceinpython.png

 

Return

An array within the specified range is returned.

Example 1

  1. import numpy as np  
  2. arr = np.logspace(10, 20, num = 5, endpoint = True)  
  3. print("The array over the given range is ",arr) 

Know more about