我正在尝试使用jupyter ide上的pandas数据读取器绘制从Google读取的数据直方图。我的命令将阅读数小时,而不会返回任何评论。
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
from pandas_datareader import data
import seaborn as sns
sns.set(style="white",color_codes=True)
from pandas.plotting import register_matplotlib_converters
register_matplotlib_converters()
ticker='GOOG'
startDate="2015-06-01"
endDate="2019-06-30"
Google=data.DataReader(ticker, 'yahoo', startDate,endDate)
pricesGOOG=Google
pricesAdjGOOG=pricesGOOG['Adj Close']
returnsGOOG=np.log(pricesGOOG).diff()
returnsGOOG=returnsGOOG.dropna()
plt.hist(returnsGOOG, density=True, histtype ='bar') #this code runs without feedback.
至少应该显示一条错误消息的直方图。