0

Hello I have a dataframe that's assigned with two labels sample and campaign:

import numpy as np
var=np.random.sample(4)
sample = [1,1,2,2]
campaign = [1,2,1,2]
d = pd.DataFrame([var, sample, campaign]).transpose()
d.columns = ['var','sample','campaign']

and I want to plot the two campaign boxplots side by side with var as the y-axis, sample as the x-axis. see here

Any idea how I can do this with seaborn? I am unsure how to manipulate the dataframe using pd.melt.. Or any other suggestion?

Cheers

Hud
  • 301
  • 1
  • 12
  • 3
    The third example in the seaborn docstring does exactly this http://seaborn.pydata.org/generated/seaborn.boxplot.html#seaborn.boxplot – Paul H Sep 09 '20 at 00:18
  • Sorry I've been staring at the screen all day. spent an hour manipulating pd.melt for some reason. Thanks ! – Hud Sep 09 '20 at 01:44

0 Answers0