-
-
Notifications
You must be signed in to change notification settings - Fork 18.7k
API: Unify .update to generic #23192
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 1 commit
0bb8325
56f569b
e1abe77
802f6ac
07784f0
f120d65
e500a22
d49b742
9183b50
411741a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -106,15 +106,25 @@ def update_array(this, that, overwrite=True, filter_func=None, | |
|
||
Returns | ||
------- | ||
updated : np.ndarray (one-dimensional) or None | ||
The updated array. Return None if `this` remains unchanged | ||
updated : np.ndarray (one-dimensional) | ||
The updated array. | ||
|
||
See Also | ||
-------- | ||
Series.update : Similar method for `Series`. | ||
DataFrame.update : Similar method for `DataFrame`. | ||
dict.update : Similar method for `dict`. | ||
""" | ||
updated = _update_array(this, that, overwrite=overwrite, | ||
filter_func=filter_func, errors=errors) | ||
return this if updated is None else updated | ||
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. @jreback However, I was not comfortable with a public function having such unexpected behaviour, so I made the function I used originally private again (but still in |
||
|
||
|
||
def _update_array(this, that, overwrite=True, filter_func=None, | ||
errors='ignore'): | ||
""" | ||
Same as update_array, except we return None if `this` is not updated. | ||
""" | ||
import pandas.core.computation.expressions as expressions | ||
|
||
if filter_func is not None: | ||
|
Uh oh!
There was an error while loading. Please reload this page.
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.
This isn't obvious from the diff (due to the code moving files), but now this keeps the dtype - yay!