We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 41ef807 commit f527f3cCopy full SHA for f527f3c
pandas/_libs/lib.pyx
@@ -991,7 +991,9 @@ def is_list_like(obj: object, allow_sets: bool = True) -> bool:
991
992
cdef inline bint c_is_list_like(object obj, bint allow_sets) except -1:
993
return (
994
- np.iterable(obj)
+ isinstance(obj, abc.Iterable)
995
+ # avoid numpy-style scalars
996
+ and not (hasattr(obj, "ndim") and obj.ndim == 0)
997
# we do not count strings/unicode/bytes as list-like
998
and not isinstance(obj, (str, bytes))
999
# exclude sets if allow_sets is False
0 commit comments