我有一个数据框,要拆分的列的内容如下:
Market Category
_______________
Luxury, Precious, Performance, Tuner
Tuner, Luxury
Precious, Performance, Luxury
Tuner, Performance
Luxury
问题是:
我想编写一个代码来拆分内容并将其扩展到新的列中。
将有4个新的列标记为:Luxury, Performance, Tuner and Precious.
展开的列将存储二进制值。如果列名连续出现,则返回1,否则返回0。