Result#

class Result(name=None, npts=None, scale=True, color=None, n_variants=0)[source]#

Bases: object

Stores a single result – by default, acts like an array.

Parameters:
  • name (str) – name of this result, e.g. new_infections

  • npts (int) – if values is None, precreate it to be of this length

  • scale (bool) – whether or not the value scales by population scale factor

  • color (str/arr) – default color for plotting (hex or RGB notation)

  • n_variants (int) – the number of variants the result is for (0 for results not by variant)

Example:

import covasim as cv
r1 = cv.Result(name='test1', npts=10)
r1[:5] = 20
print(r1.values)

Attributes

npts

Methods