Skip to content

Commit e0bd4d1

Browse files
committed
Revert is_scalar edits in _libs/lib.pyx (keep Series docstring changes)
1 parent a47688f commit e0bd4d1

File tree

1 file changed

+2
-17
lines changed

1 file changed

+2
-17
lines changed

pandas/_libs/lib.pyx

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -176,12 +176,6 @@ def is_scalar(val: object) -> bool:
176176
- Fraction
177177
- Number.
178178

179-
Objects that are explicitly treated as *non-scalar* include:
180-
- numpy.ndarray
181-
- list
182-
- tuple
183-
- pandas.Series
184-
185179
Returns
186180
-------
187181
bool
@@ -215,13 +209,6 @@ def is_scalar(val: object) -> bool:
215209
>>> from fractions import Fraction
216210
>>> pd.api.types.is_scalar(Fraction(3, 5))
217211
True
218-
219-
>>> from enum import Enum, auto
220-
>>> class Thing(Enum):
221-
... one = auto()
222-
... two = auto()
223-
>>> pd.api.types.is_scalar(Thing.one)
224-
False
225212
"""
226213

227214
# Start with C-optimized checks
@@ -1987,11 +1974,9 @@ cdef class ComplexValidator(Validator):
19871974
return cnp.PyDataType_ISCOMPLEX(self.dtype)
19881975

19891976

1990-
cdef bint is_complex_array(ndarray values, bint skipna=True):
1977+
cdef bint is_complex_array(ndarray values):
19911978
cdef:
1992-
ComplexValidator validator = ComplexValidator(values.size,
1993-
values.dtype,
1994-
skipna=skipna)
1979+
ComplexValidator validator = ComplexValidator(values.size, values.dtype)
19951980
return validator.validate(values)
19961981

19971982

0 commit comments

Comments
 (0)