Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pandas/core/dtypes/inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def iterable_not_string(obj: object) -> bool:
>>> iterable_not_string(1)
False
"""
return isinstance(obj, abc.Iterable) and not isinstance(obj, str)
return isinstance(obj, abc.Iterable) and not isinstance(obj, (str, np.str_))


@set_module("pandas.api.types")
Expand Down Expand Up @@ -467,7 +467,7 @@ def is_sequence(obj: object) -> bool:
iter(obj) # type: ignore[call-overload]
# Has a length associated with it.
len(obj) # type: ignore[arg-type]
return not isinstance(obj, (str, bytes))
return not isinstance(obj, (str, bytes, np.str_))
except (TypeError, AttributeError):
return False

Expand Down
Loading