Skip to content

Instantly share code, notes, and snippets.

@marcosan93
Created January 9, 2020 16:37
Show Gist options
  • Select an option

  • Save marcosan93/3f5010d0c5306b9b435dd86797468a33 to your computer and use it in GitHub Desktop.

Select an option

Save marcosan93/3f5010d0c5306b9b435dd86797468a33 to your computer and use it in GitHub Desktop.
# Separating each class into respective DataFrames
buy_df = final_df[final_df['Decision']==1].loc[:, final_df.columns != 'Decision'].reset_index(drop=True)
hold_df = final_df[final_df['Decision']==2].loc[:, final_df.columns != 'Decision'].reset_index(drop=True)
sell_df = final_df[final_df['Decision']==0].loc[:, final_df.columns != 'Decision'].reset_index(drop=True)
# Visualizing in matplotlib
plt.figure(figsize=(10,6))
plt.style.use('fivethirtyeight')
# Plotting the count of each DataFrame of each class
plt.bar("Buy", buy_df.shape[0])
plt.bar("Sell", sell_df.shape[0])
plt.bar("Hold", hold_df.shape[0])
plt.ylabel("# of Quarterly Reports")
plt.title('Count of Quarterly Reports')
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment