Skip to content

Commit 76bbb9c

Browse files
committed
replace dtype in with is_string_dtype
1 parent e7f3f0a commit 76bbb9c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pandas/core/dtypes/cast.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1222,7 +1222,7 @@ def construct_1d_arraylike_from_scalar(value, length, dtype):
12221222
# coerce if we have nan for an integer dtype
12231223
if is_integer_dtype(dtype) and isna(value):
12241224
dtype = np.dtype('float64')
1225-
if isinstance(dtype, np.dtype) and dtype.kind in ("U", "S"):
1225+
if isinstance(dtype, np.dtype) and is_string_dtype(dtype):
12261226
subarr = np.empty(length, dtype=object)
12271227
if not isna(value):
12281228
value = to_str(value)

0 commit comments

Comments
 (0)