Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hansalemaos/numpy_choices
Some useful np.random functions
https://github.com/hansalemaos/numpy_choices
choices numpy python random
Last synced: 19 days ago
JSON representation
Some useful np.random functions
- Host: GitHub
- URL: https://github.com/hansalemaos/numpy_choices
- Owner: hansalemaos
- License: mit
- Created: 2022-12-29T20:17:48.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2022-12-29T20:17:51.000Z (almost 2 years ago)
- Last Synced: 2024-09-14T12:42:28.255Z (2 months ago)
- Topics: choices, numpy, python, random
- Language: Python
- Homepage: https://pypi.org/project/numpy-choices/
- Size: 1000 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.MD
- License: LICENSE
Awesome Lists containing this project
README
# Some useful np.random functions
```python
$pip install numpy-choices
from numpy_choices import get_random_floats, get_random_ints, get_random_items_from_listrand = 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]
```