【发布时间】:2021-05-14 08:44:16
【问题描述】:
我正在尝试使用 python/pandas 和 matplotlib 绘制某些时间序列数据。我能够从原始 github 页面中提取如下数据。我想知道是否有办法绘制数据框中的所有列。为检索数据编写的代码如下。
import pandas as pd
import requests
import io
url = "https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_time_series/time_series_covid19_confirmed_global.csv"
download = requests.get(url).content
df = pd.read_csv(io.StringIO(download.decode('utf-8')))
filt = df['Country/Region'] == 'India'
i_rec = df[filt]
dt_filt = i_rec[df.columns.drop(['Province/State','Country/Region','Lat','Long'])]
print(dt_filt)
【问题讨论】:
标签: python pandas dataframe matplotlib