Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

binning data dataframe, faire classe statistique dataframe

# Splitting Age Column into Four Quantiles
df['Age Groups'] = pd.qcut(df['Age'], 4)
print(df.head())

# Returns:
#      Name  Age     Age Groups
# 0     Ray   12  (6.999, 17.0]
# 1    Jane    7  (6.999, 17.0]
# 2    Kate   33   (17.0, 33.5]
# 3     Nik   34   (33.5, 52.5]
# 4  Autumn   45   (33.5, 52.5]
Comment

PREVIOUS NEXT
Code Example
Python :: only int validator PyQt 
Python :: how to get index of week in list in python 
Python :: python remove non empty read only directory 
Python :: find Carmichael number sage 
Python :: programe to check if a is divisible 
Python :: creating a new folder in python 
Python :: numpy series reset index 
Python :: matplotlib multiple plots with different size 
Python :: python find all positions of element in list 
Python :: left join two dataframes pandas on two different column names 
Python :: simple gui for pygame 
Python :: discord bot python on reaction 
Python :: how to write a font in pygame 
Python :: OneID flask 
Python :: python check if variable is string 
Python :: ros python subscriber 
Python :: how to say hello with name in python 
Python :: how to extract zip file in jupyter notebook 
Python :: python saveAsTextFile 
Python :: ROLL D6 
Python :: python request example 
Python :: epoch to datetime utc python 
Python :: how to launch jupyter notebook from cmd 
Python :: how to add card in py-trello 
Python :: number guessing game python 
Python :: how to add space before capital letter in python 
Python :: pandas convert all string columns to lowercase 
Python :: check all python versions ubuntu 
Python :: pandas from series to dataframe 
Python :: previous value list loop python 
ADD CONTENT
Topic
Content
Source link
Name
1+3 =