logspace#
- class brainunit.math.logspace(start, stop, num=50, endpoint=True, base=10.0, dtype=None)#
Return numbers spaced evenly on a log scale.
In linear space, the sequence starts at
base ** startand ends withbase ** stopinnumsteps. Becausebase ** xis dimensionless,startandstopmust be dimensionless and the result is a plain array (never aQuantity).- Parameters:
start (
Array|ndarray|number|bool) –base ** startis the starting value of the sequence. Must be dimensionless.stop (
Array|ndarray|number|bool) –base ** stopis the final value of the sequence (unlessendpointisFalse). Must be dimensionless.num (
int|None) – Number of samples to generate. Default is 50.endpoint (
bool|None) – IfTrue,stopis the last sample. Otherwise, it is not included. Default isTrue.base (
float|None) – The base of the log space. Default is 10.0.dtype (
str|type[Any] |dtype|SupportsDType|None) – The type of the output array.
- Returns:
samples –
numsamples, equally spaced on a log scale.- Return type:
Array
- Raises:
UnitMismatchError – If
startorstopcarries a non-trivial unit.
Examples
>>> import saiunit as u >>> u.math.logspace(0, 2, 4) Array([ 1. , 4.6415887, 21.544348 , 100. ], dtype=float32)