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.

Syntax

Parameter

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.

Return

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

Example 1

Output

Pin It on Pinterest

Share This