Skip to content

Commit d845934

Browse files
committed
Review (jreback)
1 parent 933c600 commit d845934

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

pandas/core/frame.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -5215,8 +5215,10 @@ def update(self, other, join='left', overwrite=True, filter_func=None,
52155215
If True, will raise a ValueError if the DataFrame and `other`
52165216
both contain non-NA data in the same place.
52175217
inplace : bool, default True
5218-
If True, follows the convention by ``dict`` of updating inplace. If
5219-
False, returns a new object.
5218+
If True, updates the DataFrame inplace. If False, returns a new
5219+
DataFrame.
5220+
5221+
.. versionadded:: 0.24.0
52205222
52215223
Raises
52225224
------

pandas/tests/frame/test_combine_concat.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -212,14 +212,17 @@ def test_update(self, inplace):
212212

213213
if inplace:
214214
df.update(other, inplace=inplace)
215+
result = df
215216
else:
216-
df = df.update(other, inplace=inplace)
217+
orig = df.copy()
218+
result = df.update(other, inplace=inplace)
219+
assert_frame_equal(df, orig)
217220

218221
expected = DataFrame([[1.5, nan, 3],
219222
[3.6, 2, 3],
220223
[1.5, nan, 3],
221224
[1.5, nan, 7.]])
222-
assert_frame_equal(df, expected)
225+
assert_frame_equal(result, expected)
223226

224227
def test_update_dtypes(self):
225228

0 commit comments

Comments
 (0)