Skip to main content

Some useful np.random functions

Project description

Some useful np.random functions

$pip install numpy-choices
from numpy_choices import get_random_floats, get_random_ints, get_random_items_from_list

rand = get_random_items_from_list(
    list(range(1, 20)), size=10, replace=False, p=None, replace_raise=False
)
print(rand)
# [ 6 16 10  2  9  5 12 15  4 19]

print(get_random_ints(low=0, high=20, size=10))
# [ 0 14  3 14  3 11 15  0  4  5]

print(get_random_floats(low=0, high=20, size=10))
# [10.69714652  9.85398014  1.79753204 18.85165542  8.35101616  9.00431022
#   0.04652976  4.05292685 13.6940055   2.25818349]


    

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

numpy_choices-0.10.tar.gz (3.3 kB view hashes)

Uploaded Source

Built Distribution

numpy_choices-0.10-py3-none-any.whl (4.7 kB view hashes)

Uploaded Python 3

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