RIP
Tutorial
Tags
Topics
Examples
eBooks
Tutorial by Examples
One-hot encoding with `get_dummies()`
>>> df = pd.DataFrame({'Name':['John Smith', 'Mary Brown'], 'Gender':['M', 'F'], 'Smoker':['Y', 'N']}) >>> print(df) Gender Name Smoker 0 M John Smith Y 1 F Mary Brown N >>> df_with_dummies = pd.get_dummies(df, ...
Page 1 of 1
1
Cookie
This website stores cookies on your computer.
We use cookies to enhance your experience on our website and deliver personalized content.
For more details on our cookie usage, please review our
Cookie Policy
and
Privacy Policy
Accept all Cookies
Leave this website