#histogram #key #data #hash #mode #hashable #count

hash_histogram

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

9 unstable releases

new 0.9.0 Dec 11, 2024
0.8.0 Dec 7, 2023
0.7.0 Dec 15, 2022
0.6.2 Dec 14, 2021
0.5.2 Dec 4, 2021

#628 in Data structures

Download history 4/week @ 2024-09-18 5/week @ 2024-09-25

563 downloads per month

MIT/Apache

12KB
127 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.

<<<<<<< HEAD

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.

b9a03bd15f387ab6fa4ce26610318e1448aeeb85

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

~1–2MB
~44K SLoC