Created
January 9, 2020 16:37
-
-
Save marcosan93/3f5010d0c5306b9b435dd86797468a33 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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