Skip to content

Commit 968cdeb

Browse files
fix string dtype check
1 parent c6d65bd commit 968cdeb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pandas/core/frame.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@
107107
is_list_like,
108108
is_scalar,
109109
is_sequence,
110+
is_string_dtype,
110111
needs_i8_conversion,
111112
pandas_dtype,
112113
)
@@ -4454,7 +4455,7 @@ def _set_item_frame_value(self, key, value: DataFrame) -> None:
44544455
cols_droplevel = maybe_droplevels(cols, key)
44554456
if (
44564457
not isinstance(cols_droplevel, MultiIndex)
4457-
and cols_droplevel.dtype.type is str
4458+
and is_string_dtype(cols_droplevel.dtype)
44584459
and not cols_droplevel.any()
44594460
):
44604461
# if cols_droplevel contains only empty strings,

0 commit comments

Comments
 (0)