pydata/pandas — pull request #5380 by jtratner (2013-10-30 03:32:21+00:00)
Title: ENH: Add mode method to Series and DataFrame

Closes #5367 - generally as fast or faster than value_counts (which makes sense
because it has to construct Series), so should be relatively good
performance-wise. Also, doesn't get stuck on value_counts' pathological
case (huge array with # uniques close to/at the size of the array).

Not using result of hashtable.value_count() under the hood and instead
iterating over klib table directly gives a *huge* speedup. I just moved
the value_count table creation method to a separate function (zero perf
hit). For performance breakouts check out this gist:

https://gist.github.com/jtratner/7225878

DataFrame version delegates to Series' version at each level.