logspace#
- class saiunit.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 (
Optional[int]) – Number of samples to generate. Default is 50.endpoint (
Optional[bool]) – IfTrue,stopis the last sample. Otherwise, it is not included. Default isTrue.base (
Optional[float]) – The base of the log space. Default is 10.0.dtype (
Union[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)