Skip to content

CLN: use float64_t consistently instead of double, double_t #23583

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 19 commits into from
Nov 11, 2018
Merged
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
de-duplicate using checknull_with_nat
  • Loading branch information
jbrockmendel committed Nov 8, 2018
commit 4f4d1cffe23198d4244947c5ee09d911b748c180
16 changes: 4 additions & 12 deletions pandas/_libs/missing.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ cnp.import_array()
cimport util

from tslibs.np_datetime cimport get_timedelta64_value, get_datetime64_value
from tslibs.nattype cimport NAT
from tslibs.nattype cimport NAT, checknull_with_nat

cdef float64_t INF = <float64_t>np.inf
cdef float64_t NEGINF = -INF
Expand Down Expand Up @@ -295,9 +295,7 @@ def isneginf_scalar(val: object) -> bool:
cdef inline bint is_null_datetime64(v):
# determine if we have a null for a datetime (or integer versions),
# excluding np.timedelta64('nat')
if v is None or util.is_nan(v):
return True
elif v is NAT:
if checknull_with_nat(v):
return True
elif util.is_datetime64_object(v):
return v.view('int64') == NPY_NAT
Expand All @@ -307,9 +305,7 @@ cdef inline bint is_null_datetime64(v):
cdef inline bint is_null_timedelta64(v):
# determine if we have a null for a timedelta (or integer versions),
# excluding np.datetime64('nat')
if v is None or util.is_nan(v):
return True
elif v is NAT:
if checknull_with_nat(v):
return True
elif util.is_timedelta64_object(v):
return v.view('int64') == NPY_NAT
Expand All @@ -319,8 +315,4 @@ cdef inline bint is_null_timedelta64(v):
cdef inline bint is_null_period(v):
# determine if we have a null for a Period (or integer versions),
# excluding np.datetime64('nat') and np.timedelta64('nat')
if v is None or util.is_nan(v):
return True
elif v is NAT:
return True
return False
return checknull_with_nat(v)