【发布时间】:2021-04-15 16:29:18
【问题描述】:
我在数据框中有一个字符串列,我想从中提取一个速率,这是最后一次出现的反斜杠。
After so many requests, this is Bretagne. She was the last surviving 9/11 search dog, and our second ever 14/10. RIP*
我想得到14/10
【问题讨论】:
-
df[column].str.extract(\d+\/\d+.*?(\d+\/\d+))?
-
@politicalscientist 没用,但还是谢谢。
标签: python regex pandas dataframe