Skip to content

smrrazavian/package-sampling

Repository files navigation

Package Sampling

A Python implementation of various probability-based sampling algorithms, inspired by the R package sampling. This package offers a variety of sampling methods like Tillé's Method, Poisson Sampling, Systematic Sampling, and more, designed for unequal probability sampling. The algorithms are implemented in a way that supports both theoretical understanding and real-world use cases.

Installation

You can install the package directly from PyPI:

pip install package-sampling

Usage Example

from package_sampling.sampling import up_brewer
import numpy as np

pik = np.array([0.1, 0.2, 0.3, 0.4])

# Draw a sample using Brewer's method
samples = up_brewer(pik)
print(samples)

Authors

Mohammadreza Razavian - smrrazavian@outlook.com Bardia Panahbehagh - Panahbehagh@khu.ac.ir

Citation

If you use this package in your work, please cite it as follows:

APA Style

Razavian, M., & Panahbehagh, B. (2025). Package Sampling: A Python implementation of various probability-based sampling algorithms. https://github.com/smrrazavian/package-sampling.

BibTex

@misc{razavian2025packagesampling,
  author = {Razavian, Mohammadreza and Panahbehagh, Bardia},
  title = {Package Sampling: A Python implementation of various probability-based sampling algorithms},
  year = {2025},
  url = {https://github.com/smrrazavian/package-sampling}
}

Acknowledgments

This package is inspired by the R package "Sampling" Thanks to all contributors and users

Contributing

We welcome contributions to the package! If you have suggestions for new algorithms, improvements, or bug fixes, feel free to fork the repository and submit a pull request. Please ensure that your code adheres to the existing style and includes tests for any new functionality. Steps to Contribute:

  1. Fork the repository.
  2. Clone your fork to your local machine.
  3. Create a new branch for your changes.
  4. Make your changes and commit them with clear messages.
  5. Push your changes to your fork.
  6. Open a pull request describing your changes.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •