<jupyter_start><jupyter_text><jupyter_code>2+2 #Executing a command
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
X = np.random.normal(0,1,100)

plt.plot(X);
plt.xlabel('Time')
plt.ylabel('returns')
plt.show()
np.mean(X)
np.std(X)
!pip install quandl #add this line if you run on colab
import quandl
import matplotlib.pyplot as plt
import pandas as pd
t0 = "2017-05-16" #start-date
t1 = "2018-05-16" # end-date
i_ticker = 'WIKI/GOOG' # we import data from wiki table of Quandl
stk = quandl.get(i_ticker, start_date = t0, end_date = t1)

type(stk)
stk.head()
stk.Close.plot()
#stk.Volume.plot()

plt.title(i_ticker + "price")
plt.xlabel("date")
plt.ylabel("price")
plt.legend();

plt.show()

rolling_mean = stk['Close'].rolling(10).mean()
stk.Close.plot()
rolling_mean.plot()

plt.title(i_ticker + 'price with its rolling means')
plt.xlabel("date")
plt.ylabel("price")
plt.legend();

plt.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.15928270042194093, 'fraction_numerical': 0.03059071729957806, 'mean_word_length': 5.412162162162162, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '354347', 'license': 'MIT', 'n_tokens_mistral': 420, 'n_tokens_neox': 389, 'n_words': 91, 'path': 'src/test.ipynb', 'repo_name': 'xulisong1/test1', 'size': '948'}