import numpy as np
import pandas as pd
import pandas.io.data as web
import plotly.plotly as py
import cufflinks as cf

py.sign_in('Python-Demo-Account', 'gwt101uhh0')

"""
Explanation: <img src="http://datapark.io/img/logo.png" alt="datpark" width="35%" align="right" border="0"><br>
pandas, Plotly & Cufflinks
plotly is a plotting engine for fast easy generation of interactive D3.js plots. Cf. <a href="http://plot.ly" target="_blank">http://plot.ly</a>.
End of explanation
"""


symbols = ['AAPL', 'MSFT', 'YHOO']

data = pd.DataFrame()
for sym in symbols:
    data[sym] = web.DataReader(sym, data_source='yahoo')['Adj Close']

data.tail()

"""
Explanation: Reading Financial Data
End of explanation
"""


data.iplot(filename='financial', world_readable=True)

data['AAPL'].iplot(filename='best_fit', bestfit=True, colors=['pink'],
                bestfit_colors=['blue'], world_readable=True)

"""
Explanation: Plotting the Data
End of explanation
"""


