question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Request: logspace that doesn't require log(a) as argument

See original GitHub issue

linspace(a, b, 10) creates 10 points linearly spaced from a to b.

logspace(a, b, 10) does not create 10 points logarithmically spaced from a to b, as everyone expects it to:

The current behavior can’t be changed because of backwards/matlab compatibility, but it would be nice if there were another function that didn’t require the extra step of logspace(log(a), log(b)....

I don’t know what it should be called, though.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:1
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
jaimefriocommented, Feb 16, 2016

The syntax seems to be taken from Matlab.

I’m terrible at naming, but your function would build a geometric sequence, so maybe something along the lines of geomspace?

Also, getting rid of the base parameter seems to make all the sense here.

But we should be having this discussion on the mailing list.

0reactions
endolithcommented, Feb 18, 2016

@jaimefrio I just found spacepy.toolbox.geomspace. Same name, same syntax. 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Generate logarithmically spaced vector - MATLAB logspace
This MATLAB function generates a row vector y of 50 logarithmically spaced points between decades 10^a and 10^b.
Read more >
numpy.logspace — NumPy v1.24 Manual
Return numbers spaced evenly on a log scale. In linear space, the sequence starts at base ** start (base to the power of...
Read more >
numpy.logspace() in Python - GeeksforGeeks
The numpy.logspace() function returns number spaces evenly w.r.t interval on a log scale. Syntax : numpy.logspace(start, stop, num = 50, ...
Read more >
Does there exist any alternative of `logspace` in Julia (v1.3.1)?
This returns a generator, so it will not allocate an array, and should be easy to understand and use for other users.
Read more >
logsecond - Number of secondary log files configuration ... - IBM
For example, an application that is run once a month might require log space beyond that provided by the primary log files. Because...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found