我有一个简单的数据集。
id,question,category,tags,day,quarter,group_id
1,What is your name,Introduction,Introduction,1,3,0
2,What is your name,Introduction,"Introduction, work",1,3,1
Run Code Online (Sandbox Code Playgroud)
现在,如果您看到,该tags列中有多个用逗号分隔的输入。如果我尝试使用pandas 函数进行单热编码,get_dummies我会将其作为一列。但我想为每个标签创建列。我怎样才能做到这一点?