COVID-19: The New York TimesがCOVID-19のデータを公開, python ver. 1

I.The New York Times

 

The New York Timesは、ネット上で米国各州の感染者数の増減のグラフを比較しやすい形で提供しています。

 

https://www.nytimes.com/interactive/2020/us/coronavirus-us-cases.html?action=click&module=Top%20Stories&pgtype=Homepage

 

II.データ

 

データを次に公開しています。国、州、郡にわけられています。

 

covid-19-data

 

III.グラフ

 

ごく簡単なグラフを作成しました。

 

スクリプト

 

import pandas as pd

# Load the data
df = pd.read_csv('https://raw.githubusercontent.com/nytimes/covid-19-data/master/us-states.csv')
# display first 5 lines
df.head()

# filter by New York
countries = ['New York']
newyork = df[df.state.isin(countries)]
newyork

# create a multiple line plot for cases
newyork.pivot(index="date", columns="state", values="cases").plot(title="Cases in New York")

 

 

 

About shibatau

I was born and grown up in Kyoto. I studied western philosophy at the University and specialized in analytic philosophy, especially Ludwig Wittgenstein at the postgraduate school. I'm interested in new technology, especially machine learning and have been learning R language for two years and began to learn Python last summer. Listening toParamore, Sia, Amazarashi and MIyuki Nakajima. Favorite movies I've recently seen: "FREEHELD". Favorite actors and actresses: Anthony Hopkins, Denzel Washington, Ellen Page, Meryl Streep, Mia Wasikowska and Robert DeNiro. Favorite books: Fyodor Mikhailovich Dostoyevsky, "The Karamazov Brothers", Shinran, "Lamentations of Divergences". Favorite phrase: Salvation by Faith. Twitter: @shibatau

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.