File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -6278,10 +6278,17 @@ def fillna(
6278
6278
value_map = create_series_with_explicit_dtype (
6279
6279
value , dtype_if_empty = object
6280
6280
)
6281
- value = self .copy ()
6282
- modification_index = value .index .intersection (value_map .index )
6283
- if not modification_index .empty :
6284
- value .loc [modification_index ] = value_map [modification_index ]
6281
+ if self .dtype == "object" :
6282
+ value = self .copy ()
6283
+ modification_index = value .index .intersection (value_map .index )
6284
+ if not modification_index .empty :
6285
+ value .loc [modification_index ] = value_map [
6286
+ modification_index
6287
+ ]
6288
+ else :
6289
+ value = value_map
6290
+ value = value .reindex (self .index , copy = False )
6291
+ value = value ._values
6285
6292
elif not is_list_like (value ):
6286
6293
pass
6287
6294
else :
You can’t perform that action at this time.
0 commit comments