Skip to content

Commit 02ebf34

Browse files
committed
handle nan values in DataFrame.update when overwrite=False pandas-dev#15593
pandas-dev#15593
1 parent 3d69988 commit 02ebf34

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pandas/core/frame.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -3846,13 +3846,13 @@ def update(self, other, join='left', overwrite=True, filter_func=None,
38463846

38473847
if overwrite:
38483848
mask = isnull(that)
3849-
3850-
# don't overwrite columns unecessarily
3851-
if mask.all():
3852-
continue
38533849
else:
38543850
mask = notnull(this)
38553851

3852+
# don't overwrite columns unecessarily
3853+
if mask.all():
3854+
continue
3855+
38563856
self[col] = expressions.where(mask, this, that,
38573857
raise_on_error=True)
38583858

0 commit comments

Comments
 (0)