retta skriveleif

This commit is contained in:
Trygve 2023-11-02 11:54:14 +01:00
parent 7a3eae94b9
commit 683535b5af
1 changed files with 3 additions and 2 deletions

View File

@ -5,6 +5,7 @@ __email__ = "trygve.borte.nomeland@nmbu.no"
import numpy import numpy
import matplotlib.pyplot as plot import matplotlib.pyplot as plot
def main(): def main():
with open('pan.csv', 'r') as f: with open('pan.csv', 'r') as f:
data = numpy.array([[float(y) for y in x.split(',')[1:]] for x in f.readlines()[1:]]) data = numpy.array([[float(y) for y in x.split(',')[1:]] for x in f.readlines()[1:]])
@ -17,7 +18,7 @@ def main():
plot.title('Pandemi') plot.title('Pandemi')
plot.xlabel('dager') plot.xlabel('dager')
plot.ylabel('Andel av befolkning') plot.ylabel('Andel av befolkning')
plot.legend(['Susceptible', 'Infectious', 'Recoverd']) plot.legend(['Susceptible', 'Infectious', 'Recovered '])
plot.show() plot.show()
if __name__ == '__main__': if __name__ == '__main__':
@ -28,5 +29,5 @@ if __name__ == '__main__':
Ca. 40% av befolkningen er smittet/syke det meste. Ca. 40% av befolkningen er smittet/syke det meste.
2)Etter omtrent hvor mange dager har de fleste blitt frisk igjen? 2)Etter omtrent hvor mange dager har de fleste blitt frisk igjen?
Etter ca. 70 dager er antall "Recoverd" over 50% Etter ca. 70 dager er antall "recovered" over 50%
""" """