以下代码可以打印,但是日期时间不包含在其中,只是一个'symbol.date'字符串,我该怎么做才能解决此问题(请注意,我正在使用ipython框架)?
import numpy as np
import pandas as pd
from pandas_datareader import *
goog = DataReader('GOOG' , data_source='morningstar', start='1/1/2010' , end='1/1/2018')
goog.tail()
goog['Log_Ret'] = np.log(goog['Close'] / goog['Close'].shift(1))
goog['Volatility'] = pd.rolling_std(goog['Log_Ret'], window=252) * np.sqrt(252)
%matplotlib inline
goog[['Close' , 'Volatility']].plot(subplots=True , color='blue' , figsize=(8, 6))