我正在尝试绘制我使用Pandas DataReader从世界银行导入的数据帧。但是当我画它的时候,它显示了一个奇怪的情节。年份列和x轴显示不正确。我该怎么办?谢谢
[
from pandas_datareader import wb
import datetime
ind = ['NY.GNP.PCAP.CD']
df = wb.download(indicator=ind, country='CHN', start=2000, end=2021)
df.head()
df.plot()
NY.GNP.PCAP.CD
country year
China 2020 10610
2019 10390
2018 9600
2017 8740
2016 8270
然后可以使用pd.plotting.scatter_matrix()如下所示:
在输出中,您有如下直方图:
相关问题 更多 >
编程相关推荐