numpy.geomspace() in Python

The geomspace() function of Python numpy class returns the numbers spaced equally on a log scale (a geometric progression). This method is similar to numpy.logspace() but with endpoints specified directly.



start: This parameter represents the starting number of the sequence.
stop: It signifies the final value of the sequence unless endpoint is False.
num: The num argument represents the number of samples to generate. It is an optional parameter, and its default value is 50.
endpoint: It optional parameter which takes Boolean values. If passed true, the stop is the last sample.

dtype: This parameter represents the type of output array.


This function returns the ‘ndarray’ where the ‘num’ samples are equally spaced on a log scale.

Example 1


Pin It on Pinterest

Share This