Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

How to convert Gender to numeric variable

## Converting Gender to numeric variable(by using target ordinary encodiing)

df['Gender']=df['Gender'].map({'F':0, 'M':1})
df.head()
Comment

PREVIOUS NEXT
Code Example
Python :: what will be the output of the following python code? x = 123 for i in x: print(i) 
Python :: example of transformer 
Python :: scaling, cross validation and fitting a model through a pipline 
Python :: egt id of current object django 
Python :: pytorch plot batch 
Python :: 1045 - Triangle Types 
Python :: 2D list from dataframe column 
Python :: iterate over batch of dict keys at once python 
Python :: extract arabic text from image python 
Python :: Problème determinant algebre lineaire pdf mpsi 
Python :: pandas python multiindex 
Python :: python pyhue 
Python :: python dataframe update if not new row 
Python :: np choose explain 
Python :: run php websevrer with python 
Python :: python generator cheat sheet download 
Python :: ValueError: expected sparse matrix with integer values, found float values 
Python :: python console ending multiline input 
Python :: Character in function python 3 
Python :: mass algorithm python 
Python :: morphological filter example python 
Python :: python selenium login button class click 
Python :: Reduces the elements of this RDD using the specified commutative and associative binary operator 
Python :: entry point to programming Spark with the Dataset and DataFrame API 
Python :: how to upgrade python from 2.7 to 2.9 on ubuntu 14.04 
Python :: numpy collapse last dimension 
Python :: knn example 
Python :: python pool 
Python :: columnspan vs column tkinter 
Python :: Berlin 
ADD CONTENT
Topic
Content
Source link
Name
3+6 =