willhaslett / covid-19-growth Goto Github PK
View Code? Open in Web Editor NEWA toolkit for the Johns Hopkins and New York Times Covid-19 data. Pandas, parsed CSV and JSON, Jupyter, Firebase
License: MIT License
A toolkit for the Johns Hopkins and New York Times Covid-19 data. Pandas, parsed CSV and JSON, Jupyter, Firebase
License: MIT License
Hi!
Great repo you have there, awesome work to facilite the task for other ppl!
I wanted to ask about how are you reading the csv files https://github.com/CSSEGISandData/COVID-19/blob/master/csse_covid_19_data/csse_covid_19_time_series/time_series_19-covid-Confirmed.csv
Looking at your function
def df_from_csv(file_name):
df = pd.read_csv(file_name,sep=',')
df = df.rename(columns=constants.RENAMED_COLUMNS)
date_cols = df.filter(regex=('^\d+/\d+/\d+$')).columns.array
df = pd.melt(df, id_vars=['province_state', 'country', 'lat',
'long'], value_vars=date_cols, var_name='date', value_name='cases')
df.date = pd.to_datetime(df.date, format='%m/%d/%y')
df['day'] = (df.date - pd.to_datetime(df.date.iloc[0])).astype('timedelta64[D]')
df.day = df.day.apply(lambda day: int(round(day)))
return df[['date', 'day', 'cases', 'province_state', 'country', 'lat', 'long']]
Seems you read directly from the COVID-19 repository you have linked inside the repo, pointing directly to their files like https://github.com/CSSEGISandData/COVID-19/blob/master/csse_covid_19_data/csse_covid_19_time_series/time_series_19-covid-Confirmed.csv
But when I try to do so with a simple:
df = pd.read_csv("https://github.com/CSSEGISandData/COVID-19/blob/master/csse_covid_19_data/csse_covid_19_time_series/time_series_19-covid-Confirmed.csv")
I get the following error Error tokenizing data. C error: Expected 1 fields in line 33, saw 2
Any help on how to read them directly? Thanks!
c19us.py is erroring out on the latest JH data.
Thanks to @jiwidi for suggesting this.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.