-
-
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
DOC: Series.update throws a FutureWarning
about def[col] = df[col].method
but .update
returns None
and works inplace
#59788
Comments
Thanks for the report - can you provide a reproducible example on how CoW is not supported. |
@rhshadrach here is some code and log
FutureWarning
Inconsistency with the warning:
|
Thanks @spawn-guy, however your example is not reproducible because you did not provide |
@rhshadrach it took me some time to pick this up, but here is a small test. at first i thought it might be related to the mask that i use, but the
results in
the so, in current implementation, i don't see a way to fix this |
and if i do as the warning suggests - it will be a mistake
output
notice the all-None column |
Thanks for the example. To do this operation, you'd need to have something like: ser = df["E"]
ser.update(df["C"])
df["E"] = ser
I think you're looking for combine_first @jorisvandenbossche - thoughts on changing the warning message here? It would likely need to go into 2.3, yea? |
Pandas version checks
main
hereLocation of the documentation
https://pandas.pydata.org/docs/dev/reference/api/pandas.Series.update.html#pandas.Series.update
Documentation problem
df.update
resembles howpython.dict.update
works, butdf.update
doesn't support CoWSuggested fix for documentation
remove FutureWarning for the
df.update
or create a (for example)
df.coalesce
method that will, actually,return
something. this shouldn't brake existing codeThe text was updated successfully, but these errors were encountered: