I currently have a dataframe called df with 18 columns, and I have plotted a histogram of each to check the distribution shape of each variable using the hist() function in pandas:
df.hist(figsize=(30,30))
What I now want to do is add a boxplot above each box plot so I can understand at a glance which variables contain outliers. I want the plot to look as follows:
I can plot the boxplot using the following code, but it displays all of the boxplots on a single plot:
df.boxplot(figsize=(30,30))
And I can add a group by, however, this isn't what I require. I just want each histogram in my df.hist plot to be overlayed with the boxplot derived from the same column of data. I suspect I could write a funciton to do this, but as the hist function seems quite intuitive, I suspect there is a straighforward way that I'm probably missing.