We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 839fafb commit 0cbbcdeCopy full SHA for 0cbbcde
pandas/core/generic.py
@@ -6275,11 +6275,13 @@ def fillna(
6275
else:
6276
if self.ndim == 1:
6277
if isinstance(value, (dict, ABCSeries)):
6278
- value = create_series_with_explicit_dtype(
+ value_map = create_series_with_explicit_dtype(
6279
value, dtype_if_empty=object
6280
)
6281
- value = value.reindex(self.index, copy=False)
6282
- value = value._values
+ value = self.copy()
+ modification_index = value.index.intersection(value_map.index)
6283
+ if not modification_index.empty:
6284
+ value.loc[modification_index] = value_map[modification_index]
6285
elif not is_list_like(value):
6286
pass
6287
0 commit comments