<jupyter_start><jupyter_text>Looking at your data<jupyter_code>data.head()
data.info()
no_st = 5#data.shape[1]
data.T.head(no_st)
data[2050:].T # gives the last five rows but transposed so we can see all stocks
data[data.columns[:5]].plot(figsize=(10, 12), subplots=True);<jupyter_output><empty_output><jupyter_text>Summary Statistics<jupyter_code>data.describe().T.round(2)
data.mean()
data.aggregate([min, max, np.mean, np.std, np.median]).T.round(2)<jupyter_output><empty_output><jupyter_text>Changes over time, rolling statistics<jupyter_code>data.diff().T.head(no_st)
data.diff().mean()<jupyter_output><empty_output><jupyter_text>Percentage change<jupyter_code>data.pct_change().round(3).T.head(no_st)
rets = np.log(data/data.shift(1))
rets.head(no_st).round(3)<jupyter_output><empty_output><jupyter_text>Example of lambda function and slicing<jupyter_code>rets[rets.columns[:5]].cumsum().apply(np.exp).plot(figsize=(10, 6));

rets[rets.columns[:5]].cumsum().apply(np.exp).hist(figsize=(10, 6), bins=50);
rets[rets.columns[:5]].cumsum().apply(np.exp).boxplot(figsize=(10, 6));<jupyter_output><empty_output><jupyter_text>Resampling First we resample the data to weekly time intervals.<jupyter_code>data.iloc[:, :10].resample('1w', label='right').mean().plot(figsize=(10, 5), legend=False);<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.18442932728647016, 'fraction_numerical': 0.027210884353741496, 'mean_word_length': 9.942148760330578, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, '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': '6', 'dir': 'jupyter-structured-clean-dedup', 'id': '276260', 'license': 'MIT', 'n_tokens_mistral': 542, 'n_tokens_neox': 515, 'n_words': 65, 'path': 'notebooks/3.01 Time Series with Pandas.ipynb', 'repo_name': 'gilberto-BE/aifi-pytorch', 'size': '1323'}