我创建了一个数据框“df”,如下所示:
Name
0. School
1. Organisation
2. Teacher
3. Guest
现在我有三个清单
1. from=['12','18',['11','10'],['12','4','8']]
2. to = [['11','9'],'','8','3']
3. status = ['yes','no',['yes','no'],'']
我想将这 3 个列表添加到我现有的数据框 df 中,它应该如下所示
Name From To Status
0. School 12 11 Yes
0. School 9
1. Organisation 18 No
2. Teacher 11 8 Yes
2. Teacher 10 No
3. Guest 12 3
3. Guest 4
3. Guest 8
我试过了df['from']=from,df['to']=to 但这并没有像我预期的那样给我桌子。
智慧大石
相关分类