Skip to main content

StatsCounter: A statistics-enabled Python container

     _        _                             _
 ___| |_ __ _| |_ ___  ___ ___  _   _ _ __ | |_ ___ _ __
/ __| __/ _` | __/ __|/ __/ _ \| | | | '_ \| __/ _ \ '__|
\__ \ || (_| | |_\__ \ (_| (_) | |_| | | | | ||  __/ |
|___/\__\__,_|\__|___/\___\___/ \__,_|_| |_|\__\___|_|

StatsCounter is a GNU Licensed, statistics powered version of Python’s standard library Counter class. It attaches several helpful methods that can be used to make your data-driven uses a breeze.

Usage

As a histogram

>>> import statscounter as stats
>>> letter_freq = stats.StatsCounter(a=1, b=2, c=3, d=4, e=4, f=6)
>>> letter_freq.mean()      # average frequency
3.3333333333333335
>>> letter_freq.mode()      # most frequent element
4
>>> letter_freq.median()    # the median number (avg if even # of items)
3.5
>>> letter_freq.variance()  # sample variance
3.066666666666667
>>> letter_freq.stdev()     # sample standard deviation
1.7511900715418263
>>> letter_freq.pvariance() # population variance
2.555555555555556
>>> letter_freq.pstdev()    # population std. dev.
1.5986105077709065
>>> letter_freq.max()       # the maximum value
6
>>> letter_freq.argmax()    # the argument yielding the maximum value
"f"

As a utility

>>> import statscounter as stats
>>> stats.mean([1, 2, 3, 4, 4, 6])      # average frequency
3.3333333333333335
>>> stats.mode([1, 2, 3, 4, 4, 6])      # most frequent element
4
>>> stats.median([1, 2, 3, 4, 4, 6])    # the median number (avg if even # of items)
3.5
>>> stats.variance([1, 2, 3, 4, 4, 6])  # sample variance
3.066666666666667
>>> stats.stdev([1, 2, 3, 4, 4, 6])     # sample standard deviation
1.7511900715418263
>>> stats.pvariance([1, 2, 3, 4, 4, 6]) # population variance
2.555555555555556
>>> stats.pstdev([1, 2, 3, 4, 4, 6])    # population std. dev.
1.5986105077709065

Metadata

Release files for statscounter 0.0.010

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for statscounter 0.0.010
File Size Uploaded Provenance Actions
statscounter-0.0.010.zip 9.2 kB Without provenance Details for statscounter-0.0.010.zip

Built distribution (wheel)

Table of built distributions (wheels) for statscounter 0.0.010
File Interpreter ABI Platform Actions
statscounter-0.0.010.win-amd64.exe Details for statscounter-0.0.010.win-amd64.exe

Total release size: 240.4 kB

Release files / statscounter-0.0.010.zip

Download URL statscounter-0.0.010.zip
Size 9.2 kB
Tags Source
SHA-256 checksum
How to use checksums
c020000a2754a2b9041c9b2bf8946c48b68659b9c6fd0d910943c3611a5e8e47
BLAKE2b-256 checksum
How to use checksums
8383ca692cbb010b1a34d1eea175f6e9f1deb50461dcca57d533f55529ab460b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / statscounter-0.0.010.win-amd64.exe

Download URL statscounter-0.0.010.win-amd64.exe
Size 231.2 kB
Tags Source
SHA-256 checksum
How to use checksums
d45f06f95133fda4266a7612397af284622fbc7964cdd0c80d9f1dee56e59d0e
BLAKE2b-256 checksum
How to use checksums
20bce7de87b24d5d6f332dcba64d6ee6eb5ff46ffcdf3f0cbe72951102fd2ca6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for statscounter 0.0.010

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page