Skip to main content

Python PyPI Version License BuyMeCoffee Github Forks GitHub Open Issues Project Status Downloads Downloads Open In Colab Sphinx DOI

  • benfordslaw is Python package to test if an empirical (observed) distribution differs significantly from a theoretical (expected, Benfords) distribution. The law states that in many naturally occurring collections of numbers, the leading significant digit is likely to be small. This method can be used if you want to test whether your set of numbers may be artificial (or manipulated). If a certain set of values follows Benford's Law then model's for the corresponding predicted values should also follow Benford's Law. Normal data (Unmanipulated) does trend with Benford's Law, whereas Manipulated or fraudulent data does not.

  • Assumptions of the data:

    1. The numbers need to be random and not assigned, with no imposed minimums or maximums.
    2. The numbers should cover several orders of magnitude
    3. Dataset should preferably cover at least 1000 samples. Though Benford's law has been shown to hold true for datasets containing as few as 50 numbers.

⭐️ Star this repo if you like it ⭐️

Install benfordslaw from PyPI

pip install benfordslaw

Import benfordslaw package

from benfordslaw import benfordslaw

Documentation pages

On the documentation pages you can find detailed information about the working of the benfordslaw with many examples.


Examples

References

Citation

Please cite in your publications if this is useful for your research (see citation).

Maintainers

Contribute

  • All kinds of contributions are welcome!
  • If you wish to buy me a Coffee for this work, it is very appreciated :)

Licence

See LICENSE for details.

Metadata

Release files for benfordslaw 2.1.0

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

Source distribution (sdist)

Source distribution for benfordslaw 2.1.0
File Size Uploaded
benfordslaw-2.1.0.tar.gz 15.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for benfordslaw 2.1.0
File Interpreter ABI Platform
benfordslaw-2.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 30.0 kB

Release files / benfordslaw-2.1.0.tar.gz

Download URL benfordslaw-2.1.0.tar.gz
Size 15.1 kB
Tags Source
SHA-256 checksum
How to use checksums
a4acfe4585b4dc00c4bc879e894735592fe87723731b63c25e5f82532cac5735
BLAKE2b-256 checksum
How to use checksums
d9e21f2e0b621a979261500c89ea51175c682cffbcfcb64b7870be20971f75fc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.12

Release files / benfordslaw-2.1.0-py3-none-any.whl

Download URL benfordslaw-2.1.0-py3-none-any.whl
Size 14.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
09cc2cc41cbd107fb68e62c07d88ec78dfe7c938c7fe0e69539df1920efa2442
BLAKE2b-256 checksum
How to use checksums
5be5b1347d51951e0c0b4e19c22afb5231d0d76f436d9548f7be8fbca8653e07
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.12

Release history Release notifications | RSS feed

This release

2.1.0 This release

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.3

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

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