Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

onehotencoder = OneHotEncoder(categorical_features = [1]) X = onehotencoder.fit_transform(X).toarray() X = X[:, 1:]

from sklearn.compose import ColumnTransformer

ct = ColumnTransformer([('encoder', OneHotEncoder(), [1])], remainder='passthrough')
X = np.array(ct.fit_transform(X), dtype=np.float)
Comment

PREVIOUS NEXT
Code Example
Python :: importing time and sleep. python 
Python :: python math 
Python :: python dictionary map function 
Python :: Python program to read a random line from a file 
Python :: Fill in the gaps in the initials function so that it returns the initials of the words contained in the phrase received, in upper case. 
Python :: xlrd python read excel 
Python :: video timestamp opencv python 
Python :: pandas create dataframe from multiple dictionaries 
Python :: create a date value array in python 
Python :: label_map dict = label_map_util.get_label_map_dict(label_map) 
Python :: pyhton apend to list 
Python :: python get element by index 
Python :: requirements.txt dev python 
Python :: python telegram bot async 
Python :: not intersection list python 
Python :: selenium webdriver without opening browser 
Python :: pip not recognized 
Python :: generating datafraoms using specific row values 
Python :: python type hints list of class 
Python :: Generate hashed passwords for ansible 
Python :: pydrive download by url 
Python :: how to make a square in python 
Python :: run python in c ++ 
Python :: python argsort 
Python :: max in python 
Python :: return array of sorted objects 
Python :: Changing default fonts in matploitlibrc file 
Python :: check for root python 
Python :: how to start coding in python 
Python :: Example of ceil method in python 
ADD CONTENT
Topic
Content
Source link
Name
4+5 =