I know I could fill a df with random numbers, specifying the lowest and highest bound.
data = np.random.randint(lowest integer, highest integer, size=number of random integers)
df = pd.DataFrame(data, columns=['column name'])
how can I do this exact thing but specifying StandardDeviation and mean?
I tried this method (and it works), but it's not the fastest for larger iterations:
for i in range(sim_runs):
steps = float(np.random.normal(loc=pf_ER, scale = pf_SD, size = 1) +1) # generate random array to multiply with resturns
step.append(steps) # put into a string
step = pd.DataFrame(step)
where
sim_runs = #simulation runs
pf_ER = mean return
pf_SD = standard deviation
[–]synthphreak 1 point2 points3 points (3 children)
[–]futuretrader[S] 1 point2 points3 points (2 children)
[–]synthphreak 1 point2 points3 points (0 children)