输入df
Index col1
0 Img
1 Fruit
2 Img
3 Ball
4 Ball
5 Fruit
6 shirt
7 Fruit
映射列表以输入df
list1 = ['Img_A_10', 'Fruit_A_100', 'Ball_B_120']
输出df
col1 col22
0 Img Img_A_10
1 Fruit Fruit_A_100
2 Img Img_A_10
3 Ball Ball_B_120
4 Ball Ball_B_120
5 Fruit Fruit_A_100
6 shirt shirt
7 Fruit Fruit_A_100
试试这个
或
为了防止拆分不匹配(例如:
A_Fruit_100
),您可以extract
然后replace
相关问题 更多 >
编程相关推荐