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.

searchsorted should get a `axis` kwarg

See original GitHub issue

Is there a technical reason why searchsorted only works with 1d arrays? In a current problem, I have an array v.shape = (61, 160, 320) and an array a.shape = (1, 160, 320). It would be great if I could do np.searchsorted(a, v, axis=0) to yield a (1, 160, 320) array of the searched indices.

Issue Analytics

  • State:open
  • Created 10 years ago
  • Reactions:11
  • Comments:18 (10 by maintainers)

github_iconTop GitHub Comments

5reactions
SreenivasVRaocommented, Apr 14, 2018

Any progress with this? I’m also looking for an axis argument to searchsorted

5reactions
rob-smallshirecommented, May 18, 2017

+1 on a need for this. Major performance bottleneck in my application.

Read more comments on GitHub >

github_iconTop Results From Across the Web

applying numpy.searchsorted over multiple axes
I have to perform this operation many times, and I'm trying to find an efficient way to do so. Ultimately, I'd like to...
Read more >
aalaja/numpy-array-operations - Jovian
This function is used to return the indices of the maximum values along an axis. For example, this function can be applied practically...
Read more >
numpy.argsort — NumPy v1.24 Manual
It returns an array of indices of the same shape as a that index data along the given axis in sorted order. Parameters:...
Read more >
pandas.Series.idxmin — pandas 1.5.2 documentation
If the entire Series is NA, the result will be NA. *args, **kwargs ... Return indices of the minimum values along the given...
Read more >
API Changes — Matplotlib 1.3.1 documentation - omz:software
If you have code that modified these, you will need to make a deepcopy first ... Axes.bar() method accepts a error_kw kwarg; it...
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