-
Notifications
You must be signed in to change notification settings - Fork 0
/
data_fitting.py
25 lines (19 loc) · 1.74 KB
/
data_fitting.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
#!/usr/local/bin/python3
# NEED TO FIND RELIABLE DATASOURCE FOR COMPARISON AND PARAMETER TUNING
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
# df = pd.read_csv('https://data.humdata.org/hxlproxy/data/download/time_series-ncov-Confirmed.csv?dest=data_edit&filter01=explode&explode-header-att01=date&explode-value-att01=value&filter02=rename&rename-oldtag02=%23affected%2Bdate&rename-newtag02=%23date&rename-header02=Date&filter03=rename&rename-oldtag03=%23affected%2Bvalue&rename-newtag03=%23affected%2Binfected%2Bvalue%2Bnum&rename-header03=Value&filter04=clean&clean-date-tags04=%23date&filter05=sort&sort-tags05=%23date&sort-reverse05=on&filter06=sort&sort-tags06=%23country%2Bname%2C%23adm1%2Bname&tagger-match-all=on&tagger-default-tag=%23affected%2Blabel&tagger-01-header=province%2Fstate&tagger-01-tag=%23adm1%2Bname&tagger-02-header=country%2Fregion&tagger-02-tag=%23country%2Bname&tagger-03-header=lat&tagger-03-tag=%23geo%2Blat&tagger-04-header=long&tagger-04-tag=%23geo%2Blon&header-row=1&url=https%3A%2F%2Fraw.githubusercontent.com%2FCSSEGISandData%2FCOVID-19%2Fmaster%2Fcsse_covid_19_data%2Fcsse_covid_19_time_series%2Ftime_series_19-covid-Confirmed.csv')
# print(df.columns)
# usa = df.loc[df['Country/Region'] == 'US'].sort_values('Date')
# california = usa.loc[usa['Province/State'] == 'California']
# date = range(0, len(california['Date']))
df = pd.read_csv('https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_time_series/time_series_covid19_deaths_global.csv')
usa = df.loc[df['Country/Region'] == 'US']
count = 0
for i in range(4, len(usa.columns)):
confirmed_cases = usa.iloc[0][i]
count += confirmed_cases
print(count)
# plt.plot(date, california['Value'])
# plt.show()