#ranked #histogram #key #data #mode #hash #hashable

hash_histogram

HashHistogram creates histograms with keys of any hashable data type. Features include rank ordering and mode.

8 releases

0.8.0 Dec 7, 2023
0.7.0 Dec 15, 2022
0.6.2 Dec 14, 2021
0.5.2 Dec 4, 2021

#871 in Data structures

MIT/Apache

11KB
121 lines

Overview

HashHistogram creates histograms with keys of any hashable data type. Features include:

  • Check histogram count for a key.
  • Check total histogram counts across all keys.
  • Provide all keys in descending ranked order.
  • Find the mode of the histogram (i.e., an item with the largest number of counts)
  • Find the mode of any IntoIterator type, bulding a HashHistogram as an intermediate step.

Updates

  • 0.8.0: Added ranking_with_counts().
  • 0.7.0: HashHistogram and KeyType now implement Default.
  • 0.6.2: Fixed serious bug in bump_by().
  • 0.6.1: Added bump_by().
  • 0.6.0: Refactored mode() and mode_values() so that they only return the mode, rather than both mode and count.
  • 0.5.2: Added mode_values()
  • 0.5.1: Fixed some documentation.
  • 0.5: Initial public release.

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~0.7–1.6MB
~35K SLoC