I am looking to groupby
a subset of column names to create boxplots in python pandas.
I have the following dataset:
local_term_1year | regional_term_1year | local_term_2year | regional_term_2year
-------------------------------------------------------------------------------
30 | 30 | 40 | 50
20 | 40 | 50 | 60
I am hoping to create two grouped boxplot graphs, one for 1year and another for 2year. Also if possible I'd like to color each boxplot according to the local/regional tag.
So far I have been able to extract the suffix and prefix from each column into a separate table:
column | year | region
---------------------------------------
local_term_1year | 1year | local
regional_term_1year | 1year | regional
local_term_2year | 2year | local
regional_term_2year | 2year | regional
I am not sure if this additional dataframe will help with the boxplot.