Skip to main content

Generate approximately uniformly distributed random integer partitions.

Project description

Generate random integer partitions

This is a python wrapper for the rust crate random-partition for generating integers partitions with a given number of parts.

Example

import random_partition_py as rpp

# generates a single partition of 20 into 5 parts
print(rpp.random_partitions(20, 5))

# generates multiple partitions 
print(rpp.random_partitions(20, 5, 3))

# same thing but with an additional seed (note that the seed is kw-only)
print(rpp.random_partitions_seeded(20, 5, 3, seed=0))

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

random_partition_py-0.2.0.tar.gz (9.0 kB view hashes)

Uploaded Source

Built Distribution

random_partition_py-0.2.0-cp310-cp310-manylinux_2_34_x86_64.whl (356.5 kB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.34+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page