I try to make vertical seaborn boxplot like this
import pandas as pd
df = pd.DataFrame({\'a\' : [\'a\', \'b\' , \'b\', \'a\'], \'b\' : [5, 6, 4, 3] })
import
For seaborn's boxplots it is important to keep an eye on the x-axis and y-axis assignments, when switching between horizontal and vertical alignment:
%matplotlib inline
import pandas as pd
import seaborn as sns
df = pd.DataFrame({'a' : ['a', 'b' , 'b', 'a'], 'b' : [5, 6, 4, 3] })
# horizontal boxplots
sns.boxplot(x="b", y="a", data=df, orient='h')
# vertical boxplots
sns.boxplot(x="a", y="b", data=df, orient='v')
Mixing up the columns will cause seaborn to try to calculate the summary statistics of the boxes on categorial data, which is bound to fail.