Skip to main content

powerlaw is a toolbox using the statistical methods developed in Clauset et al. 2007 and Klaus et al. 2011 to determine if a probability distribution fits a power law. Academics, please cite as:

Jeff Alstott, Ed Bullmore, Dietmar Plenz. (2014). powerlaw: a Python package for analysis of heavy-tailed distributions. PLoS ONE 9(1): e85777

Also available at arXiv:1305.0215 [physics.data-an]

Basic Usage

For the simplest, typical use cases, this tells you everything you need to know.:

import powerlaw
data = array([1.7, 3.2 ...]) # data can be list or numpy array
results = powerlaw.Fit(data)
print results.power_law.alpha
print results.power_law.xmin
R, p = results.distribution_compare('power_law', 'lognormal')

For more explanation, understanding, and figures, see the working paper, which illustrates all of powerlaw’s features. For details of the math, see Clauset et al. 2007, which developed these methods.

Acknowledgements

Many thanks to Andreas Klaus, Mika Rubinov and Shan Yu for helpful discussions. Thanks also to Andreas Klaus, Aaron Clauset, Cosma Shalizi, and Adam Ginsburg for making their code available. Their implementations were a critical starting point for making powerlaw.

Release files for powerlaw 1.3.4

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

Source distribution (sdist)

Source distribution for powerlaw 1.3.4
File Size Uploaded
powerlaw-1.3.4.tar.gz 23.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for powerlaw 1.3.4
File Interpreter ABI Platform
powerlaw-1.3.4.macosx-10.5-x86_64.exe Details

Total release size: 109.6 kB

Release files / powerlaw-1.3.4.tar.gz

Download URL powerlaw-1.3.4.tar.gz
Size 23.0 kB
Tags Source
SHA-256 checksum
How to use checksums
f027defe034fb0742cd5e446625f1736388fe1ffbeb886654697546858d052c0
BLAKE2b-256 checksum
How to use checksums
fa6cf09b970074b73589e13f616fd954fb66d5182f088ac455aa59d54830d294
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / powerlaw-1.3.4.macosx-10.5-x86_64.exe

Download URL powerlaw-1.3.4.macosx-10.5-x86_64.exe
Size 86.7 kB
Tags Source
SHA-256 checksum
How to use checksums
2ee1a2a874ce9b14634d0dd80af0d4bfe46aa23312b282c239e4b9b86026a319
BLAKE2b-256 checksum
How to use checksums
222b646a43b8c17112bc2cdc2e3e5c19c4a7649f187282c0cb1e35be4fd438dd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

2.0.0

2 release files

1.5

1 release file

1.4.6

1 release file

1.4.5

2 release files

1.4.4

1 release file

1.4.3

1 release file

1.4.1

2 release files

1.4

3 release files

1.3.5

2 release files

This release

1.3.4 This release

2 release files

1.3.3

1.3.2

2 release files

1.3.1

2 release files

1.3

2 release files

1.2.1

2 release files

1.2

2 release files

1.1.1

2 release files

1.1

2 release files

1.0

2 release files

0.8.3

0.8.2

0.8.1

0.8

0.4.2

0.4.1

0.4

0.3.1

0.3

0.2

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