Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

compute the average age for each gender? *

In [51]: df.groupby('Gender', as_index=False).Age.mean()
Out[51]:
   Gender  Age
0  Female   18
1    Male   15
Comment

compute the average age for each gender? *

In [10]: titanic.groupby("Sex")["Age"].mean()
Out[10]: 
Sex
female    27.915709
male      30.726645
Name: Age, dtype: float64
Comment

PREVIOUS NEXT
Code Example
Python :: ev. DJANGO CREATE ACC 
Python :: how to download multiple googel images using python 
Python :: Start Openvino Python Application at Boot Time using System Service on ubunut 
Python :: features and image recongnition 
Python :: how can I get response from amazon with beautiful soap if I get 503? 
Python :: arrow.get(null) 
Python :: subprocess ffmpeg x265 codec 
Python :: online convert http query to json python 
Python :: zipfian distribution python 
Python :: user_info = user_info.save(commit=False) 
Python :: python intitialize a 2d matrix 
Python :: is file a keywoard in python 
Python :: loess dataframe 
Python :: Fancier Output Formatting in python 
Python :: change orientatin of dict read pandas 
Python :: see python function details in vscode 
Python :: assign more than one variable at a time on a single line in python 
Python :: Introduction to distutils in python 
Python :: create Charles certificate 
Python :: scatter plot points density color pandas 
Python :: how to access range of tuples in python 
Python :: python project 
Python :: get key of min value 
Python :: last value added odoo 
Python :: how to send variable to python using xlwings 
Python :: python enumerate in list comprehension with if statement 
Python :: declare variable in python 
Python :: can only concatenate str (not "ImageFieldFile") to str 
Python :: how to use google translate api in python 
Python :: python regex replace point with underscore 
ADD CONTENT
Topic
Content
Source link
Name
5+8 =