Skip to content

Commit 590c2a2

Browse files
committed
Use slightly clearer logic
1 parent 57e186b commit 590c2a2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pandas/_libs/lib.pyx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1047,8 +1047,8 @@ cdef inline bint c_is_list_like(object obj, bint allow_sets) except -1:
10471047
isinstance(obj, abc.Iterable)
10481048
# we do not count strings/unicode/bytes as list-like
10491049
and not isinstance(obj, (str, bytes))
1050-
# exclude zero-dimensional duck arrays, effectively scalars
1051-
and not (hasattr(obj, "ndim") and obj.ndim == 0)
1050+
# assume not a 0d array unless there's evidence otherwise
1051+
and getattr(obj, "ndim", 1) != 0
10521052
# exclude sets if allow_sets is False
10531053
and not (allow_sets is False and isinstance(obj, abc.Set))
10541054
)

0 commit comments

Comments
 (0)