Pandas New Column Average Of Other Columns

[Solved] Pandas New Column Average Of Other Columns | Perl - Code Explorer | yomemimo.com
Question : pandas new column average of other columns

Answered by : sleepy-shark-bmgfv96tyacr

col = df.loc[: , "salary_1":"salary_3"]
df['salary_mean'] = col.mean(axis=1)

Source : | Last Update : Fri, 02 Apr 21

Answers related to pandas new column average of other columns

Code Explorer Popular Question For Perl