【发布时间】:2017-09-06 09:45:01
【问题描述】:
我有一个数据集包含以字符串形式作为数据类型“对象”的列“useful_crit”。
Pat_ID Useful_crit
1 **inclusive range**:age 35 to 75 - type 2 diabetes **exclusive range**: type 1 diabetes
2 **inclusive range**:patients aged 21 and above **exclusive range**:patients who are mentally `
每列字符串由包含范围和排除范围两个常用词组成。现在,我想从同一个字符串中创建两列作为“包含范围”和“排除范围”。所以输出会是这样的,
Pat_ID inclusive range exclusive range
1 age 35 to 75 - type 2 diabetes type 1 diabetes
2 patients aged 21 and above patients who are mentally
如何在 python 中做到这一点?
【问题讨论】:
标签: python regex pandas dataframe