Reputation: 1
import pandas as pd
import numpy as np
from numpy.random import randn
s = pd.Series(np.random.randn(100000))
Upvotes: 0
Views: 771
Reputation: 10936
No third party packages needed, just the standard Python library:
import random
mu = 0.0
sigma = 10.0
for _ in range(100000):
print(random.gauss(mu, sigma))
You could also use random.normalvariate instead of random.gauss.
Upvotes: 1
Reputation: 658
You could do this using e.g. numpy
's random
subpackage.
import numpy as np
mean: float = 100.0
stdev: float = 3.0
n_samples: int = 100_000
samples: np.ndarray = np.random.normal(loc=mean,
scale=stdev,
size=n_samples)
Upvotes: 1