Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

pandas new column average of other columns

col = df.loc[: , "salary_1":"salary_3"]
df['salary_mean'] = col.mean(axis=1)
 
PREVIOUS NEXT
Tagged: #pandas #column #average #columns
ADD COMMENT
Topic
Name
5+4 =