Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

pandas mean and sum

d = {'Missed':'Sum1', 'Credit':'Sum2','Grade':'Average'}
df=df.groupby('Name').agg({'Missed':'sum', 'Credit':'sum','Grade':'mean'}).rename(columns=d)
Comment

PREVIOUS NEXT
Code Example
Python :: glob.iglob sort path 
Python :: python opendatasets 
Python :: python how to compress pytorch model 
Python :: how to change text in a canvas tkinter 
Python :: python colorama 
Python :: upperWhite = np.array([109, 255, 255]) 
Python :: turtle meaning 
Python :: self.tk.call( _tkinter.TclError: unknown option "-relwdth" 
Python :: new sytax in python 3 
Python :: logistic regresion heart disease python 
Python :: 1038 solution python 
Python :: adding the first place value and second value in python 
Python :: how to iterate a dictionary with minimum value in python 
Python :: "get_or_create" takes 1 positional argument but 2 were given 
Python :: put in something meaning 
Python :: 1051 texes uri solution 
Python :: sensing keyboard shortcuts using python 
Python :: python inline assignment 
Python :: python glob wildcard filename 
Python :: import all files on the same directory python 
Python :: best python library to download files 
Python :: Python Tkinter SpinBox Widget Syntax 
Python :: python linkedhashmap 
Python :: tables in django 
Python :: gensim loop through models 
Python :: python convert string object to int object 
Python :: assert isinstance python 
Python :: django template many to many count 
Python :: what is self in python constructor 
Python :: quicksort python3 
ADD CONTENT
Topic
Content
Source link
Name
8+5 =