{"library":"powerlaw","title":"powerlaw","description":"A toolbox for testing if a probability distribution fits a power law, including fitting power laws, comparing to other distributions via likelihood ratio tests, and plotting. Current version is 2.0.0 (released 2023-12-31), with major refactor from v1.x. Release cadence is irregular.","language":"python","status":"active","last_verified":"Fri May 01","install":{"commands":["pip install powerlaw"],"cli":null},"imports":["import powerlaw"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import powerlaw\nimport numpy as np\n# Generate sample data\nx = np.random.pareto(2.5, 1000)\n# Fit power law\nfit = powerlaw.Fit(x)\n# Print alpha and xmin\nprint(fit.alpha, fit.xmin)\n# Compare to exponential\nR, p = fit.distribution_compare('power_law', 'exponential')","lang":"python","description":"Fit a power law to data and compare to alternative distributions.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}