Skip to content

Commit 00a7ed8

Browse files
committed
series with dtype accept unicode
This was breaking for python 2. The fix is to use pandas text_type to return string type
1 parent 7691c82 commit 00a7ed8

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
if isinstance(dtype, np.dtype) and dtype.kind in ("U", "S"):
12231223
subarr = np.empty(length, dtype=object)
12241224
if not isna(value):
1225-
value = str(value)
1225+
value = text_type(value)
12261226
else:
12271227
subarr = np.empty(length, dtype=dtype)
12281228
subarr.fill(value)

0 commit comments

Comments
 (0)