Skip to content

Commit 0c0ab28

Browse files
committed
do not mangle nans in value_count
1 parent 58de58f commit 0c0ab28

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

pandas/_libs/hashtable_func_helper.pxi.in

+1-4
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ dtypes = [('Complex128', 'complex128', 'complex128',
3131
@cython.wraparound(False)
3232
@cython.boundscheck(False)
3333
{{if dtype == 'object'}}
34-
cdef value_count_{{dtype}}(ndarray[{{dtype}}] values, bint dropna, navalue=np.NaN):
34+
cdef value_count_{{dtype}}(ndarray[{{dtype}}] values, bint dropna):
3535
{{else}}
3636
cdef value_count_{{dtype}}(const {{dtype}}_t[:] values, bint dropna):
3737
{{endif}}
@@ -63,9 +63,6 @@ cdef value_count_{{dtype}}(const {{dtype}}_t[:] values, bint dropna):
6363
val = values[i]
6464
is_null = checknull(val)
6565
if not is_null or not dropna:
66-
# all nas become the same representative:
67-
if is_null:
68-
val = navalue
6966
k = kh_get_{{ttype}}(table, <PyObject*>val)
7067
if k != table.n_buckets:
7168
table.vals[k] += 1

0 commit comments

Comments
 (0)