get a column that corresponds to the average of two columns pandas

Solutions on MaxInterview for get a column that corresponds to the average of two columns pandas by the best coders in the world

we are a community of more than 2 million smartest coders
registration for
employee referral programs
are now open
get referred to google, amazon, flipkart and more
register now
  
pinned-register now
showing results for - "get a column that corresponds to the average of two columns pandas"
Maximiliano
12 Nov 2018
1df['avg'] = df.mean(axis=1)
2
3       Monday  Tuesday  Wednesday        avg
4Mike       42      NaN         12  27.000000
5Jenna     NaN      NaN         15  15.000000
6Jon        21        4          1   8.666667
7