Pandas version checks
-
[x] I have checked that this issue has not already been reported.
-
[x] I have confirmed this issue exists on the latest version of pandas.
-
[x] I have confirmed this issue exists on the main branch of pandas.
Reproducible Example
nlargest is so slow, I think this is question, maybe we should do someting to improve it.
Here, is my code, you can see nlargest use many time more than it should use.
Installed Versions
Prior Performance
No response
Comment From: Liam3851
You haven't provided your data or a benchmark-- does your index have duplicates? I wonder if this is related to #55767.
Comment From: Jeffrharr
Until this gets more information -- I'd like to give #55767 a shot. Looks simple enough.
Are there are performance benchmarks anywhere in case of regressions?
Comment From: rhshadrach
@Jeffrharr - it looks like no, it should likely be added to our ASVs.
Comment From: Jeffrharr
@rhendric for now, I do have a working solution to #55767 that is unlikely to cause any regressions and I'll make a PR early next week. I only fixed the bug with duplicate indices causing performance issues -- there's still some room for improvement in general.