-
Notifications
You must be signed in to change notification settings - Fork 0
/
visual.py
30 lines (21 loc) · 884 Bytes
/
visual.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
### Plots the data collected from Confirmed_case.csv and saves it in Visualizations folder
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
def graph(dataframe, index):
df = dataframe
Y = list(df.iloc[index, 1:])
plt.plot(np.arange(df.shape[1] - 1), Y)
plt.ylabel(df.iloc[index,0] + " cases")
plt.xlabel("10 minute interval count since (3/18/2020 18:53)")
plt.title(df.iloc[index,0] + " cases over time")
plt.savefig("C:/Users/qasim/Desktop/Exigence/Track-COVID/Track-COVID/Visualizations/" + df.iloc[index, 0] + ".png")
plt.close()
def main():
df = pd.read_csv("C:/Users/qasim/Desktop/Exigence/Track-COVID/Track-COVID/Confirmed_case.csv")
for x in range(df.shape[0]):
graph(df, x)
return ("Successfully updated graphs")
if __name__ == "__main__":
status = main()
print(status)