Skip to content

Commit b874308

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 a0826e9 commit b874308

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
@@ -1225,7 +1225,7 @@ def construct_1d_arraylike_from_scalar(value, length, dtype):
12251225
if isinstance(dtype, np.dtype) and dtype.kind in ("U", "S"):
12261226
subarr = np.empty(length, dtype=object)
12271227
if not isna(value):
1228-
value = str(value)
1228+
value = text_type(value)
12291229
else:
12301230
subarr = np.empty(length, dtype=dtype)
12311231
subarr.fill(value)

0 commit comments

Comments
 (0)