【发布时间】:2021-03-03 12:15:06
【问题描述】:
假设我有这两个数据框:
df1:
ID Strings
1 'hello, how are you?'
2 'I like the red one.'
3 'You? I think so.'
df2:
range Strings
[1] 'hello, how are you?'
[2,3] 'I like the red one. You? I think so.'
我的目标是获取 df1 中的句子并将它们分组,以便它们与 df2 匹配。为此,我设法找到了一种方法来标记我希望他们所在的组,所以在这个例子中,1 是独立的,但句子 2 和 3 需要结合起来。
我可以通过加入来做到这一点吗?
【问题讨论】:
标签: python pandas dataframe join merge