Skip to content

Instantly share code, notes, and snippets.

@Kazanskyi
Created September 6, 2022 14:55
Show Gist options
  • Save Kazanskyi/fca3fc3826f64fd55563dc56c1fbda14 to your computer and use it in GitHub Desktop.
Save Kazanskyi/fca3fc3826f64fd55563dc56c1fbda14 to your computer and use it in GitHub Desktop.
df_15_val.reset_index(inplace = True)
ypred_15 = pd.Series(ypred_15)
df_15_val = df_15_val.join(ypred_15.rename('15d_forecast'), how = 'left')
df_15_val["True_Forecasted"] = df_15_val.future_15dprice_class.astype(str) + " " + df_15_val["15d_forecast"].astype(str)
df_15_val[["future_15dprice_change", "True_Forecasted"]].groupby("True_Forecasted").agg({'future_15dprice_change': ['mean', 'median','min', 'max',]})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment