【发布时间】:2020-04-20 20:24:40
【问题描述】:
我有一个看起来像这样的 df:
words col_a col_b
I guess, because I have thought over that. Um, 1 0
That? yeah. 1 1
I don't always think you're up to something. 0 1
我想将 df.words 拆分为存在标点符号 (.,?!:;) 的单独行。但是,我想为每个新行保留原始行中的 col_b 和 col_b 值。例如,上面的 df 应该是这样的:
words col_a col_b
I guess, 1 0
because I have thought over that. 1 0
Um, 1 0
That? 1 1
yeah. 1 1
I don't always think you're up to something. 0 1
【问题讨论】: