Skip to content

Commit c68c67e

Browse files
committed
rename val & max_val to count & max_count
it makes more sense and it is more consistent with mode_object
1 parent 1f0f87a commit c68c67e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

pandas/hashtable.pyx

+5-5
Original file line numberDiff line numberDiff line change
@@ -1021,7 +1021,7 @@ def mode_object(ndarray[object] values, ndarray[uint8_t, cast=True] mask):
10211021

10221022
def mode_int64(ndarray[int64_t] values):
10231023
cdef:
1024-
int val, max_val = 2
1024+
int count, max_count = 2
10251025
int j = -1 # so you can do +=
10261026
int k
10271027
kh_int64_t *table
@@ -1033,12 +1033,12 @@ def mode_int64(ndarray[int64_t] values):
10331033
modes = np.empty(table.n_buckets, dtype=np.int64)
10341034
for k in range(table.n_buckets):
10351035
if kh_exist_int64(table, k):
1036-
val = table.vals[k]
1036+
count = table.vals[k]
10371037

1038-
if val == max_val:
1038+
if count == max_count:
10391039
j += 1
1040-
elif val > max_val:
1041-
max_val = val
1040+
elif count > max_count:
1041+
max_count = count
10421042
j = 0
10431043
else:
10441044
continue

0 commit comments

Comments
 (0)