Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python column = sum of list of columns

list_of_my_columns = ['Col A', 'Col E', 'Col Z']
df['Sum'] = df[list_of_my_columns].sum(axis=1)
Comment

PREVIOUS NEXT
Code Example
Python :: find nan value in dataframe python 
Python :: django models distinct 
Python :: Python find inverse of matrix 
Python :: how to create data dictionary in python using keys and values 
Python :: open python choose encoding 
Python :: change value to string pandas 
Python :: python selenium partial class name 
Python :: numpy set_printoptions 
Python :: python print string separated by comma 
Python :: tkinter app icon 
Python :: find the number of nan per column pandas 
Python :: python stop daemon thread 
Python :: python set symmetric difference 
Python :: list methods python 
Python :: python pandas convert comma separated number string to integer list 
Python :: python write 
Python :: python shuffle list with seed 
Python :: convert image to matrix python 
Python :: python print to stderr 
Python :: pandas change column name from a dictionary 
Python :: python how to change size of a window 
Python :: pygame escape key 
Python :: win32api.mouse_event python 
Python :: remove nana from np array 
Python :: python json load file 
Python :: take input in 2d list in python 
Python :: python isprime 
Python :: openpyxl xls 
Python :: install qt designer python ubuntu 
Python :: cv2 yellow color range 
ADD CONTENT
Topic
Content
Source link
Name
2+5 =