Modeling: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
| Line 9: | Line 9: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
ModSimPy is using Series from [[Pandas]]. This adds handy functions. | ModSimPy is using Series from [[Pandas]] to store results. This adds handy functions. | ||
;results.mean() | ;results.mean() | ||
:Return the mean (average) for the items in results | :Return the mean (average) for the items in results | ||
I have not studied the pandas Series yet but this works: | |||
<syntaxhighlight lang=python> | |||
from modsim import * | |||
results = TimeSeries() | |||
for a in range(100): | |||
results[a] = functioncall(bla,bla) | |||
</syntaxhighlight> | |||
TimeSeries is a modified version (subclass) of the pandas.Series class. | |||
Revision as of 21:29, 10 December 2018
Mostly based on this paper
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 modified version (subclass) of the pandas.Series class.