Generate random vectors whose components sum up to one
This Python3 module implements different approaches [1] to randomly and uniformly generate d-dimensional vectors whose components sum up to one.
[1] Maziero, J. Generating Pseudo-Random Discrete Probability Distributions. Brazilian Journal of Physics 45, 377–382 (2015). https://doi.org/10.1007/s13538-015-0337-8
Installation
Run the following to install the module:
pip install pyrandvec
Usage
from pyrandvec import sample
# Generate 10 4-dimensional vectors with the simplex-method
sample(10, 4, method = 'simplex')
# Generate 10 3-dimensional vectors with the trigonometric methdod with subsequent shuffling
sample(10, 3, method = 'trigonometric', shuffle = True)
Developing randvec
To install the pyrandvec module along with the tools you need to develop and run test, run the following command in your virtual environment (virtualenv):
pip install -e .[dev]
Metadata
Release files for pyrandvec 1.0.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 |
|---|---|---|---|---|
| pyrandvec-1.0.1.tar.gz | 4.7 kB | Without provenance | Details for pyrandvec-1.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pyrandvec-1.0.1-py3-none-any.whl | Python 3 | none | any | Details for pyrandvec-1.0.1-py3-none-any.whl |
Total release size: 9.1 kB
Release files / pyrandvec-1.0.1.tar.gz
| Download URL | pyrandvec-1.0.1.tar.gz |
|---|---|
| Size | 4.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6de9287320ae7c5b929cb786e8f011c3235c248809d3332e2fd1c32c5ea19c65
|
|
BLAKE2b-256 checksum How to use checksums |
a19a82f2046197de459f08f5588782962cbb4a802552d5021a2d4ead87874b7b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.13
|
Release files / pyrandvec-1.0.1-py3-none-any.whl
| Download URL | pyrandvec-1.0.1-py3-none-any.whl |
|---|---|
| Size | 4.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
91d16a79060911d3978b0d68911614f92f056a45333f523e5bb08cb24f4fd77a
|
|
BLAKE2b-256 checksum How to use checksums |
70e326dd55e84eee438e9054080aa6a6799d100ae0560e76c6e84089e26639cb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.13
|
Security for pyrandvec 1.0.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.