pyflux icon indicating copy to clipboard operation
pyflux copied to clipboard

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

Open stonebig opened this issue 9 years ago • 2 comments

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()

stonebig avatar Sep 15 '16 21:09 stonebig

try:
    from pandas.io.data import DataReader
except ImportError:
    from pandas_datareader.data import DataReader

s-celles avatar Sep 16 '16 05:09 s-celles

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

RJT1990 avatar Sep 17 '16 12:09 RJT1990