From 5c4d8d99fd85cab7934da0a39fc7e4a6b1ba60c5 Mon Sep 17 00:00:00 2001 From: Richard Shadrach Date: Fri, 27 Oct 2023 16:14:48 -0400 Subject: [PATCH] Simplify --- pandas/_libs/dtypes.pxd | 7 ------- pandas/_libs/lib.pyx | 6 +++--- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/pandas/_libs/dtypes.pxd b/pandas/_libs/dtypes.pxd index 8a459cc0579e0..ccfb2d2ef4a23 100644 --- a/pandas/_libs/dtypes.pxd +++ b/pandas/_libs/dtypes.pxd @@ -9,7 +9,6 @@ from numpy cimport ( int16_t, int32_t, int64_t, - npy_bool, uint8_t, uint16_t, uint32_t, @@ -35,9 +34,3 @@ ctypedef fused numeric_t: ctypedef fused numeric_object_t: numeric_t object - -# bool + all numeric types + object, doesn't include complex -ctypedef fused bool_numeric_object_t: - npy_bool - numeric_t - object diff --git a/pandas/_libs/lib.pyx b/pandas/_libs/lib.pyx index 7dd583c7a79a9..1aeb21d59ec3c 100644 --- a/pandas/_libs/lib.pyx +++ b/pandas/_libs/lib.pyx @@ -102,7 +102,7 @@ cdef extern from "pandas/parser/pd_parser.h": PandasParser_IMPORT from pandas._libs cimport util -from pandas._libs.dtypes cimport bool_numeric_object_t +from pandas._libs.dtypes cimport numeric_object_t from pandas._libs.util cimport ( INT64_MAX, INT64_MIN, @@ -2883,7 +2883,7 @@ def _map_infer_mask( ndarray[object] arr, object f, const uint8_t[:] mask, - bool_numeric_object_t[:] dummy, + numeric_object_t[:] dummy, bint convert=True, object na_value=no_default, cnp.dtype dtype=np.dtype(object) @@ -2911,7 +2911,7 @@ def _map_infer_mask( """ cdef: Py_ssize_t i, n - ndarray[bool_numeric_object_t] result + ndarray[numeric_object_t] result object val n = len(arr)