Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

benfordslaw_analysis-0.0.7.tar.gz (4.3 kB view hashes)

Uploaded Source

Built Distribution

benfordslaw_analysis-0.0.7-py3-none-any.whl (4.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page