-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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
Dropping non-finite entries #7314
Comments
You can use the option
|
Well using the example from 2
isn't this what you want? (its only slightly more tricky to NOT convert the existing nans if you have) |
ahhh yes...forgot about the |
curious that |
what do you mean inf and non-inf? isn't that everything? |
oh i see ... because isfinite doesn't work on object dtypes |
seems like a bug, dropna doesn't work on inf when dtypes are mixed and mode.use_inf_as_null is True |
Thanks @cpcloud Yes I have had the problem you just mentioned before. Also, sometimes I just want to drop |
that's a bit of a strange use case. i would suggest something like replacing nan with a string like |
or you could use |
@ribonoous i put up the fix if you want to check it out |
Is the answer to everything. should isnull/dropna do infs by default?? It seems like they may sometimes have special meaning (different from NaN). |
:) replace is that person who raises their hand to answer every question whether or not they know the answer. Judging by the way things are named I would guess that this used to be the default but for some reason was changed. |
changed here: http://pandas-docs.github.io/pandas-docs-travis/whatsnew.html#v0-10-0-december-17-2012 (look down a bit); |
we could have an |
You can do If perf is the issue convert to float! |
easy enough to fyi, maybe we should make a method (needs a better name maybe)
|
I have been looking for a solution for this for a long time. I tried the ideas in the following threads (with the latest Pandas):
but none of them work. See thread 2 above, and the comments in its only answer to see why.
What is a good way to drop indices (either rows or columns) that meet a specific criteria such as:
"they contain entries that are not finite"
.?The text was updated successfully, but these errors were encountered: