File tree 1 file changed +4
-4
lines changed
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -8857,11 +8857,11 @@ def update(
8857
8857
if not isinstance (other , DataFrame ):
8858
8858
other = DataFrame (other )
8859
8859
8860
- other = other . reindex ( self .index )
8860
+ indexes_intersection = self . index . intersection ( other .index )
8861
8861
8862
8862
for col in self .columns .intersection (other .columns ):
8863
- this = self [col ]._values
8864
- that = other [col ]._values
8863
+ this = self [col ].loc [ indexes_intersection ]. _values
8864
+ that = other [col ].loc [ indexes_intersection ]. _values
8865
8865
8866
8866
if filter_func is not None :
8867
8867
mask = ~ filter_func (this ) | isna (that )
@@ -8881,7 +8881,7 @@ def update(
8881
8881
if mask .all ():
8882
8882
continue
8883
8883
8884
- self .loc [:, col ] = expressions .where (mask , this , that )
8884
+ self [ col ] .loc [indexes_intersection ] = expressions .where (mask , this , that )
8885
8885
8886
8886
# ----------------------------------------------------------------------
8887
8887
# Data reshaping
You can’t perform that action at this time.
0 commit comments