Skip to content

Commit a156d2c

Browse files
znichollskeewis
andauthored
Simplify ndim check
Co-authored-by: keewis <keewis@users.noreply.github.com>
1 parent ca94b7d commit a156d2c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pandas/_libs/lib.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -995,7 +995,7 @@ cdef inline bint c_is_list_like(object obj, bint allow_sets) except -1:
995995
# we do not count strings/unicode/bytes as list-like
996996
and not isinstance(obj, (str, bytes))
997997
# exclude zero-dimensional duck arrays, effectively scalars
998-
and not (hasattr(obj, "ndim") and obj.ndim == 0)
998+
and getattr(obj, "ndim", 0) != 0
999999
# exclude sets if allow_sets is False
10001000
and not (allow_sets is False and isinstance(obj, abc.Set))
10011001
)

0 commit comments

Comments
 (0)