import pandas as pd
import io
import requests
url="https://raw.githubusercontent.com/ryan-2121/data/595128c71d558943d0fbc518dcca618a7273d058/product_care" # using the raw link from github
s=requests.get(url).content
df = pd.read_csv(io.StringIO(s.decode()), sep=",", header=None, names = ['Region','Market','Chart',"Name","Unit","Source","2014","2015","2016","2017",'2018',"2019","2020","2021","2022",'2023',"2024","2025","2026","2027"] )
df.drop(index=df.index[0], axis=0, inplace=True) # The first row contains the column name, hence dropping it.
1条答案
按热度按时间cgh8pdjw1#
您必须使用GitHub中的
Raw
链接,因为您提供的链接返回HTML
页面。