Python Error One Hot Encoding With Both Type Object And String

Python Error One Hot Encoding With Both Type Object And String Error message is: cannot perform reduce with flexible type with type string with type object. you have overwritten your df by df = ohe.fit transform( ), just name the variable something else. try this: but the column that i am encoding is different. or does it not matter?. But now, onehotencoding could directly work with string data types also, but here we need data to be of type either a dataframe or a 2d array (not object type) example [50,1]. now you can do so, this way: from sklearn.preprocessing import onehotencoder onehotencoder = onehotencoder().

Typeerror Expected String Or Bytes Like Object In Python Its Linux Foss

One Hot Encoding In Python A Practical Approach Askpython

One Hot Encoding In Python A Practical Approach Askpython
Comments are closed.