Skip to content

Commit f9cf44b

Browse files
committed
Revert to relying on python's shortcircuit operators
Also avoid np.iterable
1 parent ceda737 commit f9cf44b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pandas/_libs/lib.pyx

+3-1
Original file line numberDiff line numberDiff line change
@@ -1035,7 +1035,9 @@ def is_list_like(obj: object, allow_sets: bool = True) -> bool:
10351035

10361036
cdef inline bint c_is_list_like(object obj, bint allow_sets) except -1:
10371037
return (
1038-
np.iterable(obj)
1038+
isinstance(obj, abc.Iterable)
1039+
# avoid numpy-style scalars
1040+
and not (hasattr(obj, "ndim") and obj.ndim == 0)
10391041
# we do not count strings/unicode/bytes as list-like
10401042
and not isinstance(obj, (str, bytes))
10411043
# exclude sets if allow_sets is False

0 commit comments

Comments
 (0)