我正在尝试将此表转换为pandas数据帧。我的问题是熊猫不认识表中的负值。在
import pandas as pd
url = 'http://www.scb.se/en_/Finding-statistics/Statistics-by-subject-area/Prices-and-Consumption/Consumer-Price-Index/Consumer-Price-Index-CPI/Aktuell-Pong/33779/Consumer-Price-Index-CPI/287612/'
df = pd.read_html(url,index_col='Year',header=0,parse_dates=True)[0]
print(df)
有什么建议吗?在
提前谢谢你
该表使用不同的hyphen character,而不是ASCII减号。您可以执行类似的操作来替换并重新转换为float。在
相关问题 更多 >
编程相关推荐