We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 57860a8 commit f41dd55Copy full SHA for f41dd55
pandas/_libs/tslibs/util.pxd
@@ -33,7 +33,7 @@ cdef extern from "Python.h":
33
const char* PyUnicode_AsUTF8AndSize(object obj,
34
Py_ssize_t* length) except NULL
35
36
-from numpy cimport int64_t
+from numpy cimport int64_t, float64_t
37
38
cdef extern from "numpy/arrayobject.h":
39
PyTypeObject PyFloatingArrType_Type
@@ -235,7 +235,11 @@ cdef inline bint is_nan(object val):
235
-------
236
is_nan : bool
237
"""
238
- return (is_float_object(val) or is_complex_object(val)) and val != val
+ cdef float64_t fval
239
+ if is_float_object(val):
240
+ fval = val
241
+ return fval != fval
242
+ return is_complex_object(val) and val != val
243
244
245
cdef inline const char* get_c_string_buf_and_size(object py_string,
0 commit comments