Git Product home page Git Product logo

Comments (1)

plix1014 avatar plix1014 commented on May 21, 2024

There is a 2nd change necessary for the US analysis.
US states are now in a seperated csv file. You need to read in this too.
df_us = pd.read_csv('https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_time_series/time_series_covid19_confirmed_US.csv')

Below "US COVID-19 Analysis" In[8] read from df_us. Replace '/' by '_', remove additional columns from df_us.

uscases = df_us[df_us['Country_Region'] == 'US'].copy()

[...]

for index, row in uscases.iterrows():
location = row['Province_State']
try:
if ',' in location:
result = [x.strip() for x in location.split(',')]
statename = states[result[1]]
row['State'] = statename
uscases.loc[index, 'Province_State'] = statename
except:
print('Error parsing US state:', location)

uscases.drop(['UID', 'iso2', 'iso3', 'code3', 'FIPS', 'Admin2','Combined_Key'], axis=1, inplace=True)
usstatesummary = uscases.iloc[:,[0,-1]].groupby('Province_State').sum()
#[...]

from covid.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.