-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
groupby().first() skips NaN values #6732
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
Yup, you can use nth (for the moment skipping NaN is a feature of first/last):
@jreback Now, I recall why I haven't changed first/last yet, I need make these have a way to get this old (weird?) behaviour, similar to Series nth. |
@hayd Thanks, if this is intended behavior then you can close this if you like. I'll leave it up to you. |
@hayd I think
|
@hayd we need to change first/last to use nth right? (and will fix the perf issue as well) |
Yeah, perf of the dropping NaN will still be an issue. (Easiest soln is just to leave current implementation "as is" when using dropna=True / default). |
@hayd you are covering this one I believe as well? |
yes |
@hayd ping! |
might want to add dropna kw to first/last to emulate this behavior (but can put that off to 0.14.1 if you want). However, I think that
|
I can confirm first keeps ignoring NaNs in pandas 0.25 |
I can confirm first keeps ignoring NaNs in pandas 1.0.1 |
If it's really how it works (which was a nice surprise to me) then it could be mentioned in the docs :) |
I do this
but I expected this
Is it possible to achieve my expected output? I get the same output in master and 0.13.1.
The text was updated successfully, but these errors were encountered: