我有以下数据集:
df = pd.DataFrame({'sentence':["sentence1", "sentence2"],
'Parent': [[['x', 'HackOrg'], ['xx', 'Purpose'], ['xxx', 'Area'], ['xxxx', 'HackOrg']], [['xxxxx', 'Exp'], ['xxxxxx', 'Idus'], ['xxxxxxx', 'Area'], ['xxxxxxxx', 'Area']]]
})
sentence Parent
0 sentence1 [[x, HackOrg], [xx, Purpose], [xxx, Area], [xx...
1 sentence2 [[xxxxx, Exp], [xxxxxx, Idus], [xxxxxxx, Area]...
我想得到下面的输出
sentence HackOrg Purpose Area HackOrg Exp Idus Area Area
o sentence1 x xx xxx xxxx
1 sentence2 xxxxx xxxxxx xxxxxxx xxxxxxxx
有什么想法吗?
2条答案
按热度按时间iezvtpos1#
试试看:
打印:
zed5wv102#
使用整形:
输出: