How to use the get_dummies () method in Pandas
This article is to share with you about how to use the get_dummies () method in Pandas. The editor thinks it is very practical, so I share it with you to learn. I hope you can get something after reading this article.
Series.str.get_dummies (sep=' |') splits the string and returns a complex matrix of individual characters
Parameters:
Sep: string. Default is "|"
Return value:
Data frame (DataFrame)
> Series (['a | baked, np.nan,'a | c']) .str.get_dummies () a b c0101 0002 01 above is how to use the get_dummies () method in Pandas. The editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.