Skip to content
Advertisement

Tag: seaborn

Ordering a stacked histplot based on total counts

I have a dataframe which results from: Then, df_grouped is something like: A B count A_1 B_1 10 A_1 B_2 51 A_1 B_3 25 A_1 B_4 12 A_1 B_5 2 A_2 B_1 19 A_2 B_3 5 A_3 B_5 18 A_3 B_4 33 A_3 B_5 44 A_4 B_1 29 A_5 B_2 32 I have plotted a seaborn.histplot using the following code:

ValueError: Could not interpret input ‘0’ with Seaborn?

I’m using the Kepler exoplanet dataset. After loading it, and running a simple transpose() on it, in order to get the rows as columns, I try a seaborn boxplot, as follows: This returns: I also attempted this: and got a KeyError: ‘0’ instead. What am I doing wrong? As far as I can tell, I’m doing the exact same thing

Advertisement