March 2019
Beginner to intermediate
464 pages
10h 57m
English
Next, we will try to see if there are any differences in the distributions of bank balances between the conversion and non-conversion groups. A box plot is typically a good way to visualize the distribution of a variable. Let's take a look at the following code:
ax = df[['conversion', 'balance']].boxplot( by='conversion', showfliers=True, figsize=(10, 7))ax.set_xlabel('Conversion')ax.set_ylabel('Average Bank Balance')ax.set_title('Average Bank Balance Distributions by Conversion')plt.suptitle("")plt.show()
You should be familiar with this code by now, as we have discussed how to build box plots using the pandas package. Using the boxplot function, we can easily build box plots such as the following:
Because there ...
Read now
Unlock full access