March 2019
Beginner to intermediate
464 pages
10h 57m
English
The last thing that we are going to look at before we dive into the regression analysis are the differences in the distributions of Total Claim Amount between the engaged and non-engaged groups. We are going to visualize this by using box plots. Let's first look at how we can build box plots in Python, as follows:
ax = df[['Engaged', 'Total Claim Amount']].boxplot( by='Engaged', showfliers=False, figsize=(7,5))ax.set_xlabel('Engaged')ax.set_ylabel('Total Claim Amount')ax.set_title('Total Claim Amount Distributions by Engagements')plt.suptitle("")plt.show()
As you can see in this code, it is quite straightforward to build box plots from a pandas DataFrame. You can simply call the boxplot function. Box plots are a great ...
Read now
Unlock full access