Skip to content

Commit 27bd4e4

Browse files
committed
Update to use numpy iterable
1 parent 590c2a2 commit 27bd4e4

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

pandas/_libs/lib.pyx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1044,11 +1044,9 @@ def is_list_like(obj: object, allow_sets: bool = True) -> bool:
10441044

10451045
cdef inline bint c_is_list_like(object obj, bint allow_sets) except -1:
10461046
return (
1047-
isinstance(obj, abc.Iterable)
1047+
np.iterable(obj)
10481048
# we do not count strings/unicode/bytes as list-like
10491049
and not isinstance(obj, (str, bytes))
1050-
# assume not a 0d array unless there's evidence otherwise
1051-
and getattr(obj, "ndim", 1) != 0
10521050
# exclude sets if allow_sets is False
10531051
and not (allow_sets is False and isinstance(obj, abc.Set))
10541052
)

0 commit comments

Comments
 (0)