How do I create dummy variables in pandas?

How do I create dummy variables in pandas?

86.855 Lượt nghe
How do I create dummy variables in pandas?
If you want to include a categorical feature in your machine learning model, one common solution is to create dummy variables. In this video, I'll demonstrate three different ways you can create dummy variables from your existing DataFrame columns. I'll also show you a trick for simplifying your code that was introduced in pandas 0.18. SUBSCRIBE to learn data science with Python: https://www.youtube.com/dataschool?sub_confirmation=1 JOIN the "Data School Insiders" community and receive exclusive rewards: https://www.patreon.com/dataschool == RESOURCES == GitHub repository for the series: https://github.com/justmarkham/pandas-videos "map" documentation: http://pandas.pydata.org/pandas-docs/stable/generated/pandas.Series.map.html "get_dummies" documentation: http://pandas.pydata.org/pandas-docs/stable/generated/pandas.get_dummies.html "iloc" documentation: http://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.iloc.html "concat" documentation: http://pandas.pydata.org/pandas-docs/stable/generated/pandas.concat.html == LET'S CONNECT! == Newsletter: https://www.dataschool.io/subscribe/ Twitter: https://twitter.com/justmarkham Facebook: https://www.facebook.com/DataScienceSchool/ LinkedIn: https://www.linkedin.com/in/justmarkham/