[SciPy-user] logspace

David M. Cooke cookedm at physics.mcmaster.ca
Tue Dec 6 23:11:00 CST 2005

On Tue, Dec 06, 2005 at 08:32:35PM -0500, Alan G Isaac wrote:
> Proposed redefinition of logspace:
> def logspace(start,stop,num=50,endpoint=True,base=10.0):
>     """Evenly spaced numbers on a logarithmic scale.
>     Computes int(num) evenly spaced exponents from start to stop.
>     If endpoint=True, then last exponent is stop.
>     Returns base**exponents.
>     """
>     y = linspace(start,stop,num=int(num),endpoint=endpoint)
>     return _nx.power(base,y)

Liking it, committed.

Oh, and I'm still going with for num=1, returning [start] instead of
[stop]. I feel the invariant for that overrides whatever endpoint is set
to. (Besides, num=1 is such a corner case that whoever tries to do that
won't be happy with either case :-)

|David M. Cooke                      http://arbutus.physics.mcmaster.ca/dmc/
|cookedm at physics.mcmaster.ca

More information about the SciPy-user mailing list