We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c7c4c94 commit 6e77c81Copy full SHA for 6e77c81
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
@@ -215,7 +215,11 @@ cdef inline bint is_nan(object val):
215
-------
216
is_nan : bool
217
"""
218
- return (is_float_object(val) or is_complex_object(val)) and val != val
+ cdef float64_t fval
219
+ if is_float_object(val):
220
+ fval = val
221
+ return fval != fval
222
+ return is_complex_object(val) and val != val
223
224
225
cdef inline const char* get_c_string_buf_and_size(object py_string,
0 commit comments