I'm new to python and trying to use the numpy.random
triangular function to run a series of Monte Carlo simulations from several triangular distributions and then append the simulation outputs from each run. The sample data is as below.
ID Low Mode High
A 10 15 25
B 7 20 22
C 2 18 20
D 1 4 5
E 13 25 34
I would like to run 10000 runs for each ID and append the results. I know I can run for each ID for example ID A using np.random.triangular(10, 15, 25, 10000)
. May need to write for loop to run and append all IDs. Thank you!
Update!
The expected output format is:
ID Run Output
A 1 11
A 2 23
.
.
.
A 10000 18
B 1 21.5
B 2 9
. . .
. . .
. . .
B 10000 19
C 1 2.5
C 2 13
. . .
. . .
. . .