Open BoPeng opened 4 years ago
@wuben2602
I changed the interface a bit to make it easier to use the script as a pipe. I have found a few problems with the script
python report2csv.py pop_quarantine_all.txt
looks wrong.n_second_symptom_on_day_1
and n_third_symptom_on_day_1
in the csv, which should not be there. If it is difficult to judge from header, removing columns with NA might do the job.Please also test the script with non-1 intervals, e.g. --plugin stat --interval 2
and --plugin stat --interval 0.5
.
@BoPeng could you specify what about the output is wrong?
Download the test file from the main post, run
python report2csv.py pop_quarantine_all.txt
and at least the last lines look like
,,,,0.0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,0.0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,0.0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,0.0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,713.0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,725.0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,3499.0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,3499.0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,713.0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,725.0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,0.2038,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,0.2072,,,,,,,,,
185.0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,2.0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
The summary report we have right now is a two column format with variable name and values, which can be a single number or a list.
It is a bit difficult to analyze such data so let us try to convert it to a tabular format.
Let us assume that we have report
pop_quarantine_all.txt
(attached) generated from the following commandpop_quarantine_all.txt
Let us convert it to a
.csv
file, with time in the first column, andavg_n_active
etc as columns. The key steps aren_recorded_0
for replicate 0,n_recorded_1
for replicate 1 etc.After the table is generated, it can be useful to draw some x-y plots. In this case, the "average" values can be the main lines, 'replicate" values can provide confidence interval and range. Interesting variables can be
n_recovered
,n_infected
,n_active
, or their percentage equivalences (incidence rate ...).Any tool can be used.