0

I created a loop which creates a sns distplot with all variables in 1 dataframe however I'm trying to overlay a 2nd dataframe with the same columns to compare the differences in distribution.

I've checked out this answer (and others) to no avail : How can I overlay two graphs in Seaborn?

This is what I currently have:

    for i, col in enumerate(mean_loan_data_float.columns):
     plt.figure(i)
     ax= sns.distplot(mean_loan_data_float[col])
     ax.set_xticklabels(ax.get_xticklabels(), rotation=40, ha="right")
     plt.tight_layout()
     plt.show()

My 2nd dataframe is called median_loan_data_float.

What I want is to have mean_loan_data_float AND median_loan_data_float in the same graphs. I'm thrown by what to do when I want to have a second for loop.

Bake.G
  • 123
  • 1
  • 1
  • 12

0 Answers0