I have a data set that contains countries and statistics on economic indicators by year, organized like so:
Country Metric 2011 2012 2013 2014
Is this what you are looking for:
df = df.groupby(['Metric']) df.get_group('GDP') Country Metric 2011 2012 2013 2014 0 USA GDP 7 4 0 2 2 GB GDP 8 7 0 7 4 FR GDP 5 0 0 1