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 d6202ce commit d0c5877Copy full SHA for d0c5877
pandas/core/array_algos/take.py
@@ -563,7 +563,10 @@ def _take_preprocess_indexer_and_fill_value(
563
fill_value = int(fill_value)
564
dtype, fill_value = maybe_promote(arr.dtype, fill_value)
565
if dtype != arr.dtype:
566
- if not (lib.is_float(fill_value) and np.isnan(fill_value)):
+ if not (
567
+ (lib.is_float(fill_value) and np.isnan(fill_value))
568
+ or (arr.dtype.kind == "U" and isinstance(fill_value, str))
569
+ ):
570
# GH#53910
571
warnings.warn(
572
"reindexing with a fill_value that cannot be held by the "
0 commit comments