I have what superficially appears to be a simple question, but I cannot find the answer. I have a feature in my df for which I would like to use groupby on two different categories. Here's my metacode:
df = pd.DataFrame(np.random.rand(100,2), columns=['Col1', 'Col2'] )
# Assume each series below repeats.
df['X'] = pd.Series(['A','B','A','B',...,'A','B','A','B'])
df['Y'] = pd.Series(['X','Y','X','Y',...,'X','Y','X','Y'])
How can I use groupby to create 4 box plotsfor a particular feature in the df? (Eg, keys {'A','X'},{'B','X'},{'A','Y'},{'B','Y'}) for the each data series? I can do the following:
df['Col1'].groupby([df.X,df.Y]).describe()
...what's the analogy for box plot?