Sequential Poisson sampling
Sequential Poisson sampling is a variation of Poisson sampling for drawing probability-proportional-to-size samples with a given number of units, and is commonly used for price-index surveys. This package is a Python implementation of the {sps} R package.
Installation
Install the stable release from PyPI
python -m pip install pysps
or get the development version from github
python -m pip install git+https://github.com/marberts/pysps.git
Usage
The first step to draw a sample is to construct the inclusion probabilties for each unit in the population.
>>> import pysps
>>> pi = pysps.InclusionProb([1, 2, 3, 4], 3)
>>> pi
InclusionProb(array([0.33333333, 0.66666667, 1. , 1. ]), 3)
Now these inclusion probabilities can be used to create a sample.
>>> samp = pysps.OrderSample(pi)
>>> samp.units
array([1, 2, 3])
>>> samp.weights
array([1.5, 1.0, 1.0])
Citation
If you use this software, please cite it
@software{pysps,
author = {Martin, Steve},
doi = {10.5281/zenodo.15825865},
license = {MIT},
title = {{pysps: Sequential Poisson sampling}},
version = {0.1.1},
year = {2025}
}
Metadata
Release files for pysps 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pysps-0.1.1.tar.gz | 7.8 kB | Without provenance | Details for pysps-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pysps-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for pysps-0.1.1-py3-none-any.whl |
Total release size: 15.3 kB
Release files / pysps-0.1.1.tar.gz
| Download URL | pysps-0.1.1.tar.gz |
|---|---|
| Size | 7.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a13a13505a608e5e06efe57c4ad0cd1b0cabda4275a02b085a5ed12cf7fb4ddd
|
|
BLAKE2b-256 checksum How to use checksums |
354ed965c6271b07da212e120fc18914a1876f1535378aafcb13aac24f703f5c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.5
|
Release files / pysps-0.1.1-py3-none-any.whl
| Download URL | pysps-0.1.1-py3-none-any.whl |
|---|---|
| Size | 7.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2b52813c8493a754d5efa4291d338522850fe32a6d287e85f6f05d7a97bddbab
|
|
BLAKE2b-256 checksum How to use checksums |
ce267ec1d2dc3145aa5453bfa40725765ade8bdee8fb322dfd524415f806ac33
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.5
|
Security for pysps 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.