average columns pandas dataframe code example
Example 1: mean of a column pandas
df["Column"].mean()
Example 2: pandas new column average of other columns
col = df.loc[: , "salary_1":"salary_3"]
df['salary_mean'] = col.mean(axis=1)
df["Column"].mean()
col = df.loc[: , "salary_1":"salary_3"]
df['salary_mean'] = col.mean(axis=1)