Skip to content

Commit 1228b6e

Browse files
committed
use is_real_number_object in testing.pyx
1 parent d36ef84 commit 1228b6e

File tree

1 file changed

+5
-21
lines changed

1 file changed

+5
-21
lines changed

pandas/_libs/testing.pyx

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,33 +6,17 @@ from numpy cimport import_array
66

77
import_array()
88

9-
from pandas._libs.util cimport is_array
9+
from pandas._libs.util cimport (
10+
is_array,
11+
is_real_number_object
12+
)
1013

1114
from pandas.core.dtypes.common import is_dtype_equal
1215
from pandas.core.dtypes.missing import array_equivalent, isna
1316

1417

15-
cdef NUMERIC_TYPES = (
16-
bool,
17-
int,
18-
float,
19-
np.bool_,
20-
np.int8,
21-
np.int16,
22-
np.int32,
23-
np.int64,
24-
np.uint8,
25-
np.uint16,
26-
np.uint32,
27-
np.uint64,
28-
np.float16,
29-
np.float32,
30-
np.float64,
31-
)
32-
33-
3418
cdef bint is_comparable_as_number(obj):
35-
return isinstance(obj, NUMERIC_TYPES)
19+
return is_real_number_object(obj)
3620

3721

3822
cdef bint isiterable(obj):

0 commit comments

Comments
 (0)