-
Notifications
You must be signed in to change notification settings - Fork 0
/
lineplot.py
38 lines (26 loc) · 1.24 KB
/
lineplot.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
31
32
33
34
35
36
37
38
# -*- coding: utf-8 -*-
"""LinePlot.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1hEBXEki21MG81AGEGmrLJwJyqzdibhjR
"""
from google.colab import drive
drive.mount("/content/drive/")
import pandas as pd
import numpy as np
import os
os.listdir("/content/drive/My Drive/ProbStats Project")
deaths = pd.read_csv("/content/drive/My Drive/Probability Project/csse_covid_19_data/csse_covid_19_data/csse_covid_19_time_series/time_series_covid19_deaths_global.csv")
cases = pd.read_csv("/content/drive/My Drive/Probability Project/csse_covid_19_data/csse_covid_19_data/csse_covid_19_time_series/time_series_covid19_confirmed_global.csv")
recovered = pd.read_csv("/content/drive/My Drive/Probability Project/csse_covid_19_data/csse_covid_19_data/csse_covid_19_time_series/time_series_covid19_recovered_global.csv")
cases.columns[4:]
dates = deaths.columns[4:]
dates
recovered.columns[4:]
data = []
ndeaths = deaths.values[0,4:]
ncases = cases.values[0,4:]
nrecovered = recovered.values[0,4:]
for ix in range(len(dates)):
data.append([dates[ix],ndeaths[ix],ncases[ix],nrecovered[ix]])
pd.DataFrame(data, columns = ['date','deaths','cases','recovered']).to_csv("myfile.csv",index = False)