Last active
March 31, 2022 17:49
-
-
Save zheng95z/2f1458bee8f054ad776ea55a6aa2f23c to your computer and use it in GitHub Desktop.
[Random sampling in numpy] #numpy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Reference: | |
https://numpy.org/doc/stable/reference/random/generator.html | |
""" | |
import numpy as np | |
# Get Random Generator and set seed for reproducibility | |
rng = np.random.default_rng(114514) | |
# Draw samples from a uniform distribution | |
samples = rng.uniform(low=0.0, high=1.0, size=(16, 16)) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment