【发布时间】:2021-09-03 04:02:40
【问题描述】:
我有这个 df:
id description
0 changed status to **In progress** of this task
1 changed status to **Closed** of this task
2 changed status to **Testing** of this task
3 changed status to **Update** of this task
4 changed status to **Completed** of this task
我想通过从描述列中提取** 之间的子字符串来子集这个df,例如In Progress、Closed、Testing、Update 和Completed。
我按照一些堆栈溢出的解决方案尝试了正则表达式,例如:
import re
re.search('**(.+?)**', df.description)
但是我收到了这个错误:
error: nothing to repeat at position 0
知道如何解决这个问题吗?
【问题讨论】: