Python Forum
Basic storage of function values for monte carlo simulation - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: Data Science (https://python-forum.io/forum-44.html)
+--- Thread: Basic storage of function values for monte carlo simulation (/thread-25887.html)



Basic storage of function values for monte carlo simulation - glidecode - Apr-14-2020

I'm testing out some simple monte carlo simulations which I'd like to plot on a graph.

Here is an idea about how to do this:

1) Create an empty dataframe to store values

2) Run loop and for each run add my list of values to a new column i dataframe

3) Plot entire dataframe

My questions:

Would this make sense or is there a much more pythonic way of doing it?


RE: Basic storage of function values for monte carlo simulation - jefsummers - Apr-15-2020

Only thing I would say is to rotate it - for each run add a row, instead of a column.