<jupyter_start><jupyter_text>pandas, Plotly & Cufflinks<jupyter_code>import warnings; warnings.simplefilter('ignore')
import numpy as np
import pandas as pd
from pandas_datareader import data as web
import plotly.plotly as py
import cufflinks as cf
py.sign_in('Python-Demo-Account', 'gwt101uhh0')<jupyter_output><empty_output><jupyter_text>Reading Financial Data<jupyter_code>symbols = ['AAPL', 'MSFT', 'YHOO', 'FB']
data = pd.DataFrame()
for sym in symbols:
    data[sym] = web.DataReader(sym, data_source='yahoo')['Adj Close']
data.tail()<jupyter_output><empty_output><jupyter_text>Plotting the Data<jupyter_code>data.iplot(filename='financial', world_readable=True)
# daily log returns
rets = np.log(data / data.shift(1))
rets.iplot(subplots=True, kind='hist', filename='financial_hist',
           world_readable=True)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.13145539906103287, 'fraction_numerical': 0.005868544600938967, 'mean_word_length': 8.074468085106384, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '525636', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 317, 'n_tokens_neox': 302, 'n_words': 59, 'path': 'plotly_cufflinks.ipynb', 'repo_name': 'yhilpisch/cloud-python', 'size': '852'}