import pandas as pd
import quandl as qndl
import datetime as dt
import matplotlib.pyplot as plt
import QuandlAPIKey (My QUANDL API KEY, IGNORE THIS.)
data = qndl.get_table('AUSBS/D')
dataframe = pd.DataFrame(data)
sorteddataframe = dataframe.sort_values(by='date')
dfdate = sorteddataframe[['date']]
dfvalue = sorteddataframe[['value']]
dfx = dfdate
dfy = dfvalue
values_to_read = 100
print(sorteddataframe.head(values_to_read))
plt.plot(dfx.head(values_to_read),dfy.head(values_to_read))
plt.xlabel("Years")
plt.ylabel("Stock Values (Scaled down by 10%)")
plt.show()
我已经检查了数据框(dfx,dfy,sorteddataframe),它们都已正确排序,但是生成的图形只是一条简单的垂直线。图片已发布。