RJT1990 / pyflux

Open source time series library for Python
BSD 3-Clause "New" or "Revised" License
2.11k stars 240 forks source link

pandas.io.data is now deprecated in pandas 0.19rc2 #42

Open stonebig opened 7 years ago

stonebig commented 7 years ago

in http://www.pyflux.com/metropolis-hastings/

import numpy as np
import pyflux as pf
try:
    from pandas.io.data import DataReader
except:
    from pandas_datareader.data import DataReader
from datetime import datetime
import matplotlib.pyplot as plt
import matplotlib.mlab as mlab
%matplotlib inline 

fb = DataReader('FB',  'yahoo', datetime(2013,1,1), datetime(2016,6,10))
fb['Logged Adj Close'] = np.log(fb['Adj Close'].values)
plt.figure(figsize=(15,5))
plt.plot(fb.index[1:len(fb.index)],np.diff(fb['Adj Close'].values))
plt.ylabel('Returns')
plt.title('IBM Returns')
plt.show()
scls19fr commented 7 years ago
try:
    from pandas.io.data import DataReader
except ImportError:
    from pandas_datareader.data import DataReader
RJT1990 commented 7 years ago

Thanks - I am aware of this, and will update docs when I see the deprecated module