Pure Python implementation of discrete random variables
Project description
This is a Pure Python implementation of several discrete probability distributions. There are no external dependencies.
Why would you use this over, say, numpy and scipy? The main reason would be is if, for whatever reason, you’re unable to install C extensions (for example, you need to work with 32-bit Python on a 64-bit system) and just need to generate random events. The Python random module supports generating events for several continuous random distributions not discrete ones, hence this module.
Usage
All implemented distributions are a subclass of the abstract Discrete class, with pdf(k), cdf(k), and generate(n) methods. The generate method returns an array of size n populated with randomly distributed variables from the distribution.
Currently the Poisson and Binomial distributions are implemented. More will likely be added in the future.
Legal
discrete is released under the MIT License; see attached LICENSE file.
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
File details
Details for the file discrete-0.0.2.tar.gz
.
File metadata
- Download URL: discrete-0.0.2.tar.gz
- Upload date:
- Size: 4.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7212cd1b645c2f798abb12b5cf80b44e2623ad2c83ff8ed603999404a8bd2d24 |
|
MD5 | 4ca55207b7f1b1009e994dbc07226267 |
|
BLAKE2b-256 | 9a06013d76986dfedab6af098046ac4daf16ee864b437bd8a35cca36e1e906b6 |