freq
Frequency Calculator for Python
Installation
pip install freq
Use
from freq import Freq
freqs = Freq(["US", "US", "US", "CA"])
# Freq({'US': 0.75, 'CA': 0.25})
Methods
Because Freq subclasses counter you should be able to use all the same methods as Counter.
Versions
Freq works has been tested and works with the following Python versions:
- "2.7"
- "3.3"
- "3.4"
- "3.5"
- "3.5-dev" # 3.5 development branch
- "3.6"
- "3.6-dev" # 3.6 development branch
- "3.7-dev" # 3.7 development branch
Testing
python3 -m unittest freq.test