Use this package to analyse your data with Benford's law
Project description
Benford's law analysis
Benford's law is a digit-law, which states that the distribution of seperate digits in numbers follow a specific frequency. This specific frequency is seen in many numerical datasets, as discovered by Simon Newcomb and Frank Benford. You can find on wikipedia more information about this mysterious law.
Benford's law might be helpful to detect fraud, do science, or just investigate the quality of data.
Installation
By pip install benfordslaw_analysis
you will install the package.
Usage
Now you can do from benfordslaw_analysis import analysis
to obtain the analysis script.
Here there is the class BenfordsLaw
which you can get with analysis.BenfordsLaw
.
Now you can analyse your data.
For example, make a plot with Benford's law versus random data with:
from random import uniform
random_data = [uniform(-10, 10) for i in range(0,1000)]
bl = analysis.BenfordsLaw(random_data)
bl.plot_first_digit()
Note that we use the Euclidean distance between the digit frequency from Benford's law and your own data.
This package is still under development. More updates and documentation will come...
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for benfordslaw_analysis-0.0.7.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2ab3a93fcf8fc520834076847609882ccf3eea1541a9e21cd2203fb9a815ddce |
|
MD5 | d40bb6178b79519219a59a50be10de44 |
|
BLAKE2b-256 | f115663780dbddf95a830ae5543d43b995d9e5e956a977cdaeb9c026f6e47889 |
Hashes for benfordslaw_analysis-0.0.7-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 90f76ead1dc33cbbd9d84893a35c478f4bc836808a5b98b69a3568b1cb26971d |
|
MD5 | 00eb1f1bf3da0e0a71878a9e7ed4c5df |
|
BLAKE2b-256 | 3bbf2a732abb2eb6731255b2c312bf8446db10d1bee6a9053960c9136cbc881e |