Skip to content

CLN: revisit build warnings in cython templates #27346

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 2 commits into from Jul 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
12 changes: 10 additions & 2 deletions pandas/_libs/groupby_helper.pxi.in
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,11 @@ def group_last_{{name}}({{c_type}}[:, :] out,
val = values[i, j]

# not nan
if val == val and val != {{nan_val}}:
if (
{{if not name.startswith("int")}}
val == val and
{{endif}}
val != {{nan_val}}):
nobs[lab, j] += 1
resx[lab, j] = val

Expand Down Expand Up @@ -133,7 +137,11 @@ def group_nth_{{name}}({{c_type}}[:, :] out,
val = values[i, j]

# not nan
if val == val and val != {{nan_val}}:
if (
{{if not name.startswith("int")}}
val == val and
{{endif}}
val != {{nan_val}}):
nobs[lab, j] += 1
if nobs[lab, j] == rank:
resx[lab, j] = val
Expand Down
8 changes: 6 additions & 2 deletions pandas/_libs/hashtable_class_helper.pxi.in
Original file line number Diff line number Diff line change
Expand Up @@ -424,8 +424,12 @@ cdef class {{name}}HashTable(HashTable):
for i in range(n):
val = values[i]

if ignore_na and (val != val
or (use_na_value and val == na_value2)):
if ignore_na and (
{{if not name.lower().startswith(("uint", "int"))}}
val != val or
{{endif}}
(use_na_value and val == na_value2)
):
# if missing values do not count as unique values (i.e. if
# ignore_na is True), skip the hashtable entry for them,
# and replace the corresponding label with na_sentinel
Expand Down