Quantcast
Channel: How to perform OneHotEncoding in Sklearn, getting value error - Stack Overflow
Viewing all articles
Browse latest Browse all 5

Answer by Amirtaha Ehsaei for How to perform OneHotEncoding in Sklearn, getting value error

$
0
0

to make the long story short, if you are looking to dummify your df, use dummy=pd.get_dummies as:

dummy=pd.get_dummies(df['str'])df=pd.concat([df,dummy], axis=1)print(Data)

Viewing all articles
Browse latest Browse all 5

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>