Import pandas and load data from CSV file:
import pandas as pd
df = pd.read_csv('https://raw.githubusercontent.com/sledilnik/data/master/csv/cases.csv', parse_dates=['date'])
Check columns in dataframe
df.info()
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 1005 entries, 0 to 1004
Data columns (total 10 columns):
# Column Non-Null Count Dtype
--- ------ -------------- -----
0 date 1005 non-null datetime64[ns]
1 cases.confirmed 989 non-null float64
2 cases.confirmed.todate 1005 non-null int64
3 cases.active 992 non-null float64
4 cases.closed.todate 991 non-null float64
5 cases.recovered.todate 990 non-null float64
6 cases.rh.occupant.confirmed.todate 996 non-null float64
7 cases.hs.employee.confirmed.todate 224 non-null float64
8 cases.rh.employee.confirmed.todate 221 non-null float64
9 cases.vaccinated.confirmed.todate 351 non-null float64
dtypes: datetime64[ns](1), float64(8), int64(1)
memory usage: 78.6 KB
Inspect data
df.head()
date | cases.confirmed | cases.confirmed.todate | cases.active | cases.closed.todate | cases.recovered.todate | cases.rh.occupant.confirmed.todate | cases.hs.employee.confirmed.todate | cases.rh.employee.confirmed.todate | cases.vaccinated.confirmed.todate | |
---|---|---|---|---|---|---|---|---|---|---|
0 | 2020-03-04 | 1.0 | 1 | NaN | NaN | NaN | NaN | NaN | NaN | NaN |
1 | 2020-03-05 | 5.0 | 6 | NaN | NaN | NaN | NaN | 1.0 | NaN | NaN |
2 | 2020-03-06 | 4.0 | 10 | NaN | NaN | NaN | NaN | 3.0 | NaN | NaN |
3 | 2020-03-07 | 5.0 | 15 | NaN | NaN | NaN | NaN | 3.0 | NaN | NaN |
4 | 2020-03-08 | 5.0 | 20 | NaN | NaN | NaN | NaN | 5.0 | 1.0 | NaN |
Plot something :)
df.plot(x='date', y='cases.recovered.todate', figsize=(15, 10))
<AxesSubplot:xlabel='date'>