Created
July 22, 2019 17:58
-
-
Save lzkelley/dab81e38c495d44306864a335955d210 to your computer and use it in GitHub Desktop.
random-stuff
This file contains 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
import numpy as np | |
import scipy as sp | |
import scipy.stats | |
import matplotlib.pyplot as plt | |
NUM = 100 | |
xx = np.random.uniform(-1.0, 1.0, NUM) | |
plt.hist(xx) | |
NUM = 1000 | |
SIGMA = 100 | |
xx = sp.stats.maxwell.rvs(scale=SIGMA, size=NUM) | |
plt.hist(xx, bins=30) | |
NUM = 10000 | |
xx = np.random.uniform(0.0, 1.0, NUM) | |
yy = np.power(xx, 1/3) | |
bins = np.linspace(0.0, 1.0, 11) | |
plt.hist(xx, color='blue', alpha=0.5, bins=bins) | |
plt.hist(yy, color='red', alpha=0.5, bins=bins) | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment