Average of Dataframe columns
问题 I want to get the average GDP of each country across the years, the columns 2006, 2007...2015 contain the GDP numbers... My code returns an error that mean(axis=1) needs at least 1 variable, and 1 has been assign to it... which is weird..I also find it weird that we are using mean instead of avg, but coulnd't find an avg function for groupby here is my code Top15 = ANSWER Top15 = Top15[['Country', '2006', '2007', '2008', '2009', '2010', '2011', '2012', '2013', '2014', '2015']] return Top15