<jupyter_start><jupyter_text>Google Trends<jupyter_code># Ploteamos la series.
fig, ax = plt.subplots(nrows=1, ncols=1, figsize=(20,10))
df[['Close', 'Interest']].plot(kind='line', secondary_y='Interest',  ax=ax)
ax.axvline(pd.datetime(year=2012, month=11, day=28), ls='--', color='r')
ax.axvline(pd.datetime(year=2016, month=7, day=9), ls='--', color='r')
ax.axvline(pd.datetime(year=2020, month=5, day=11), ls='--', color='r')
plt.title('Google Trends interest about bitcoin')
plt.xlabel('Timestamp')
plt.grid()
plt.show()
# Ploteamos la series.
fig, ax = plt.subplots(nrows=1, ncols=1, figsize=(20,10))
df[['CloseFFD', 'Interest']].plot(kind='line', secondary_y='Interest',  ax=ax)
ax.axvline(pd.datetime(year=2012, month=11, day=28), ls='--', color='r')
ax.axvline(pd.datetime(year=2016, month=7, day=9), ls='--', color='r')
ax.axvline(pd.datetime(year=2020, month=5, day=11), ls='--', color='r')
plt.title('Google Trends interest about bitcoin')
plt.xlabel('Timestamp')
plt.grid()
plt.show()
# Ploteamos la series.
fig, ax = plt.subplots(nrows=2, ncols=2, figsize=(20,10))

mask = df.index < pd.datetime(year=2012, month=11, day=28)
df.loc[mask, ['Close','Interest']].plot(kind='line', secondary_y='Interest',  ax=ax[0][0])

mask = ((df.index >= pd.datetime(year=2012, month=11, day=28)) & (df.index < pd.datetime(year=2016, month=7, day=9)))
df.loc[mask, ['Close','Interest']].plot(kind='line', secondary_y='Interest',  ax=ax[0][1])

mask = ((df.index >= pd.datetime(year=2016, month=7, day=9)) & (df.index < pd.datetime(year=2020, month=5, day=11)))
df.loc[mask, ['Close','Interest']].plot(kind='line', secondary_y='Interest',  ax=ax[1][0])

mask = (df.index >= pd.datetime(year=2020, month=5, day=11))
df.loc[mask, ['Close','Interest']].plot(kind='line', secondary_y='Interest',  ax=ax[1][1])

ax[0][0].grid()
ax[0][1].grid()
ax[1][0].grid()
ax[1][1].grid()

ax[0][0].set_title('Before 1st halving')
ax[0][1].set_title('Before 2nd halving')
ax[1][0].set_title('Before 3rd halving')
ax[1][1].set_title('After 3rd halving')

ax[0][0].set_xlabel('Timestamp')
ax[0][1].set_xlabel('Timestamp')
ax[1][0].set_xlabel('Timestamp')
ax[1][1].set_xlabel('Timestamp')

plt.show()<jupyter_output><empty_output><jupyter_text>Alternative me<jupyter_code># Ploteamos la series.
fig, ax = plt.subplots(nrows=1, ncols=2, figsize=(20,10))

mask = ((df.index >= pd.datetime(year=2016, month=7, day=9)) & (df.index < pd.datetime(year=2020, month=5, day=11)))
df.loc[mask, ['Close','SentimentIndex']].plot(kind='line', secondary_y='SentimentIndex',  ax=ax[0])

mask = (df.index >= pd.datetime(year=2020, month=5, day=11))
df.loc[mask, ['Close','SentimentIndex']].plot(kind='line', secondary_y='SentimentIndex',  ax=ax[1])

ax[0].grid()
ax[1].grid()

ax[0].set_title('Before 3rd halving')
ax[1].set_title('After 3rd halving')

ax[0].set_xlabel('Timestamp')
ax[1].set_xlabel('Timestamp')

plt.show()
df['CloseFFD'].corr(df['Interest'])
df['CloseFFD'].corr(df['SentimentIndex'])<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.24347826086956523, 'fraction_numerical': 0.05819397993311037, 'mean_word_length': 8.091185410334347, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 14, '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': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '521472', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 1320, 'n_tokens_neox': 1209, 'n_words': 189, 'path': 'src/notebooks/social_features.ipynb', 'repo_name': 'agalbachicar/swing_for_the_fences', 'size': '2990'}