Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

how to do label encoding in multiple column at once

# We can use label encoding on multiple column at once by using method
from sklearn.preprocessing import LabelEncoder
df[cat_c] = df[cat_c].apply(LabelEncoder().fit_transform)
Comment

PREVIOUS NEXT
Code Example
Python :: flask how to run app 
Python :: python tkinter clear textbox 
Python :: how to raise a error in python 
Python :: pymysql check if table exists 
Python :: load diamonds dataset from sns 
Python :: how to send audio with inline telebot 
Python :: pandas to csv encoding 
Python :: get eth balance python 
Python :: python fiscal year prior 
Python :: linux uninstall python 
Python :: filter dataframe by index 
Python :: pandas read csv parse_dates 
Python :: classification report value extration 
Python :: random numbers in python 
Python :: python plot cut off when saving 
Python :: check palindrome in python using recursion 
Python :: django annotate concat string 
Python :: pandas show all dataframe 
Python :: pyttsx3 speech to mp3 
Python :: check the input format of a date python 
Python :: django load model by name 
Python :: pandas display rows config 
Python :: olst = [] a = int(input()) b = int(input()) for ele in range(a,b+1): if ele%2 != 0: olst.append(ele) print(olst[::-1]) 
Python :: pythoni me numra 
Python :: how to remove stopwords from a string in python 
Python :: how to get hostname from ip python 
Python :: sort dictionary python 
Python :: how to recurse a function 
Python :: sort list of files by name python 
Python :: python similar strings 
ADD CONTENT
Topic
Content
Source link
Name
5+2 =