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

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