<jupyter_start><jupyter_text>*** Create a variable S0 equal to the last adjusted closing price of Microsoft. Use the “iloc” method.<jupyter_code>S0 = data.iloc[-1]
S0<jupyter_output><empty_output><jupyter_text>Create a variable price_list with the same dimension as the daily_returns matrix.<jupyter_code>price_list = np.zeros_like(daily_returns)
price_list
price_list[0]<jupyter_output><empty_output><jupyter_text>Set the values on the first row of the price_list array equal to S0.<jupyter_code>price_list[0] = S0
price_list<jupyter_output><empty_output><jupyter_text>Create a loop in the range (1, t_intervals) that reassigns to the price in time t the product of the price in day (t-1) with the value of the daily returns in t.<jupyter_code>for t in xrange(1, t_intervals):
    price_list[t] = price_list[t - 1] * daily_returns[t]
price_list<jupyter_output><empty_output><jupyter_text>Finally, plot the obtained price list data.<jupyter_code>plt.figure(figsize=(10,6))
plt.plot(price_list);<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.095703125, 'fraction_numerical': 0.0146484375, 'mean_word_length': 7.541666666666667, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, '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': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '233406', 'license': 'MIT', 'n_tokens_mistral': 371, 'n_tokens_neox': 364, 'n_words': 97, 'path': 'MC Stock Price 3.ipynb', 'repo_name': 'vivekvision/MonteCarlo', 'size': '1024'}