Skip to content

Commit 30d77b8

Browse files
committed
adding explanation
1 parent 8b93a53 commit 30d77b8

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pandas/_libs/hashtable_func_helper.pxi.in

+6
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,12 @@ cpdef value_count_{{dtype}}(const {{dtype}}_t[:] values, bint dropna):
9696

9797
int ret = 0
9898

99+
# we track the order in which keys are first seen (GH39009),
100+
# khash-map isn't insertion-ordered, thus:
101+
# table maps key to index_of_appearence
102+
# result_keys maps index_of_appearence to key
103+
# result_counts maps index_of_appearence to number of elements
104+
99105
result_keys = {{name}}Vector()
100106
result_counts = Int64Vector()
101107
table = kh_init_{{ttype}}()

0 commit comments

Comments
 (0)