-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
DOC: update the DataFrame.update() docstring #20201
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
Changes from 2 commits
10f998d
5d9d44b
3965924
714ead4
ee07bc6
6443994
2ce7982
ff0b3fa
4bb134d
8167356
8838631
77b7e3b
4c2e352
eade529
ce18a26
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4207,17 +4207,23 @@ def update(self, other, join='left', overwrite=True, filter_func=None, | |
raise_conflict=False): | ||
""" | ||
Modify DataFrame in place using non-NA values from passed | ||
DataFrame. Aligns on indices | ||
DataFrame. | ||
|
||
Aligns on indices. | ||
|
||
Parameters | ||
---------- | ||
other : DataFrame, or object coercible into a DataFrame | ||
Index should be similar to one of the columns in this one. If a | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't really understand "Index should be similar to one of the columns in this one". What do you want to say here? |
||
Series is passed, its name attribute must be set, and that will be | ||
used as the column name in the resulting joined DataFrame. | ||
join : {'left'}, default 'left' | ||
Indicates which column values overwrite. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's actually not valid. I tried it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think you can say "Only left join is implemented, keeping the index and columns of the original object" |
||
overwrite : boolean, default True | ||
If True then overwrite values for common keys in the calling frame | ||
If True then overwrite values for common keys in the calling frame. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. and what if False? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it that case only NA values in the calling object are updated |
||
filter_func : callable(1d-array) -> 1d-array<boolean>, default None | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "default None" -> "optional" |
||
Can choose to replace values other than NA. Return True for values | ||
that should be updated | ||
that should be updated. | ||
raise_conflict : boolean | ||
If True, will raise an error if the DataFrame and other both | ||
contain data in the same place. | ||
|
@@ -4276,6 +4282,14 @@ def update(self, other, join='left', overwrite=True, filter_func=None, | |
0 1 4.0 | ||
1 2 500.0 | ||
2 3 6.0 | ||
|
||
See also | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See Also (note capitalization) should go before the examples. |
||
-------- | ||
DataFrame.merge : For column(s)-on-columns(s) operations | ||
|
||
Returns | ||
------- | ||
updated : DataFrame | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Rerturns goes right after the Parameters section. |
||
""" | ||
import pandas.core.computation.expressions as expressions | ||
# TODO: Support other joins | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May have to reword this so the first line isn't too long? Does the validation script complain about this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The validation script actually did not complain, but I'll try to adjust it.