-
Notifications
You must be signed in to change notification settings - Fork 21
nan to null strategy? #142
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
That seems like useful/necessary functionality indeed.
Those both seems useful in principle. That's for actually filling values though (see the polars I also note that in polars, Given that |
|
I think I like
I don't think there is yet. It'd usually be done with indexing like |
sure, let's do fillnan then just a comment on df == float('nan') , there'd be no guarantees about this, right? I think people should use |
you're completely right there. I remembered we had |
Anyway, if we have idx = df.get_columns().index(label)
col = df.get_column_by_name(label).fillna(None)
df = df.drop_column(label).insert(idx, label, col) |
Addresses half of data-apisgh-142 (`fill_null` is more complex, and not included here).
gh-167 adds For
Adding "fill with scalar value" is easy, anything else I'm less sure about. |
I think it would be fine to start with the case of filling with a scalar |
After the discussion today, folks seemed to agree that adding The strategy that was discussed as perhaps useful was filling nulls with the corresponding element of another column - but there weren't any active users of that, so we can punt on it for now. |
Addresses half of data-apisgh-142 (`fill_null` is more complex, and not included here).
Follow-up to data-apisgh-167, which added `fill_nan`, and closes data-apisgh-142.
Follow-up to data-apisgh-167, which added `fill_nan`, and closes data-apisgh-142.
Both cudf and polars have both null and nan (and there's some discussion about having in pandas too), and they both have methods for converting nans to nulls:
DataFrame.nans_to_nulls
: https://docs.rapids.ai/api/cudf/stable/api_docs/api/cudf.dataframe.nans_to_nulls.fill_nan(None)
I think we need something similar here. Perhaps
fill_nans
andfill_nulls
would be most generic?The text was updated successfully, but these errors were encountered: