Skip to content

Commit

Permalink
replace dtype in with is_string_dtype
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikoleta-v3 committed Sep 4, 2018
1 parent e7f3f0a commit 76bbb9c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pandas/core/dtypes/cast.py
Expand Up @@ -1222,7 +1222,7 @@ def construct_1d_arraylike_from_scalar(value, length, dtype):
# coerce if we have nan for an integer dtype
if is_integer_dtype(dtype) and isna(value):
dtype = np.dtype('float64')
if isinstance(dtype, np.dtype) and dtype.kind in ("U", "S"):
if isinstance(dtype, np.dtype) and is_string_dtype(dtype):
subarr = np.empty(length, dtype=object)
if not isna(value):
value = to_str(value)
Expand Down

0 comments on commit 76bbb9c

Please sign in to comment.