这是我的数据框:
Name Job
A Back-end Engineer
B Front-end Engineer;Product Manager
C Product Manager;Business Development;System Analyst
我想将该数据帧转换为虚拟(一种热编码),如下所示:
Name Back-end Engineer Business Development Front-end Engineer Product Manager System Analyst
A 1 0 0 0 0
B 0 0 1 1 0
C 0 1 0 1 0
我尝试使用 pandas.get_dummies 但它失败了,因为变量是多变量的。