Difference between revisions of "Modeling"

From wiki
Jump to navigation Jump to search
Line 1: Line 1:
Mostly based on [http://greenteapress.com/ModSimPy/ModSimPy.pdf this paper]
+
Mostly based on [http://greenteapress.com/ModSimPy/ModSimPy.pdf this paper] that comes with its own modsim library.
  
 
=Eyeopeners=
 
=Eyeopeners=
Line 20: Line 20:
 
     results[a] = functioncall(bla,bla)
 
     results[a] = functioncall(bla,bla)
 
</syntaxhighlight>
 
</syntaxhighlight>
TimeSeries is a modified version (subclass) of the pandas.Series class.
+
TimeSeries is a modsim modified version (subclass) of the pandas.Series class.

Revision as of 15:41, 15 December 2018

Mostly based on this paper that comes with its own modsim library.

Eyeopeners

Store results in a list.

for a in range(100):
    funcAresults[a] = functionAcall(bla,bla)
    funcBresults[a] = functionBcall(bla,bla)

ModSimPy is using Series from Pandas to store results. This adds handy functions.

results.mean()
Return the mean (average) for the items in results

I have not studied the pandas Series yet but this works:

from modsim import *
results = TimeSeries()
for a in range(100):
    results[a] = functioncall(bla,bla)

TimeSeries is a modsim modified version (subclass) of the pandas.Series class.