In [1]:
import pickle as pkl
import pandas as pd
%matplotlib inline
In [2]:
! echo $PATH
In [3]:
! pypy3 simulation.py
In [4]:
! python simulation.py
In [5]:
with open('results/simulation.pkl', 'rb') as f:
results = pkl.load(f)
In [6]:
data = pd.DataFrame(results)
In [7]:
data.columns
Out[7]:
In [8]:
# Plot hosts
data[['n_blue_immune', 'n_red_immune', 'n_immune']].plot()
Out[8]:
In [9]:
# Plot viruses.
data[['n_blue_virus', 'n_red_virus', 'n_mixed']].plot()
Out[9]:
In [10]:
data[['n_contacts']].plot()
Out[10]:
In [ ]: