-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
PERF: .median(axis=1) perf issues #16468
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I get similar results
Why isn't bottleneck a dependency of Pandas? I didn't even know I did not have it installed until now. Even when I set |
see here: http://pandas.pydata.org/pandas-docs/stable/install.html#recommended-dependencies these could be deps, but and #9422, which bottleneck changed in 1.0 (breaking the previous, IMHO correct API). |
in any event, this is easily fixed by using |
okay, working on the fix |
done: #16509 |
So, if bottleneck is installed, then
df.median(1)
is blazingly fast. However if its NOT installed (or not used), then we fallback tonp.apply_along_axis(our_median_impl)
, so our median impl is pretty fast itself, but it only handles 1d, so this is a pythonic loop.To fix we can use
np.nanmedian
soln if available (its in >= numpy 1.9, currently we support >= 1.7).The text was updated successfully, but these errors were encountered: