Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

pandas new column average of other columns

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

PREVIOUS NEXT
Code Example
Python :: clean column names pandas 
Python :: openai python 
Python :: windows 10 reset django migrations 
Python :: python insert sorted list 
Python :: one line if statement no else 
Python :: python http request params 
Python :: spam python 
Python :: matplotlib log scale y axis base 
Python :: drop first two rows pandas 
Python :: python filter dictionary by keys 
Python :: progress bar in cmd python 
Python :: get dictionary value python 
Python :: import antigravity in python 
Python :: how to find in which directory my python code is running 
Python :: extract one column from dataframe python 
Python :: access first element of dictionary python 
Python :: django queryset first element 
Python :: how to append items to a list in python 
Python :: convert timestamp to date python 
Python :: import django value 
Python :: get a list as input from user 
Python :: how to bulk update in mongodb using python 
Python :: django queryset group by 
Python :: uninstall python using powershell 
Python :: tkinter window size 
Python :: virtualenv python2 
Python :: Python Roman to Integer method 2 
Python :: python selenium click element 
Python :: how to print a list of strings in python 
Python :: python array usage 
ADD CONTENT
Topic
Content
Source link
Name
5+2 =