从 python 中的文本数据中提取数字和相邻单词
Extract numbers and the neighboring words from text data in python
我在数据框的一列中有文本字符串数据
Text Column
The doctor has advised the patient to pay 0 for the treatment
Patient submitted the 0 operation fee but not the admit fee 0
从上面,如何提取数字和数字前后的单词并将它们存储在单独的变量中
Expected Results
Var1 Var2
pay 0 for
the 0 operation fee 0
([a-zA-Z]+) *?$?([0-9]+) ?([a-zA-Z]*)
我在数据框的一列中有文本字符串数据
Text Column
The doctor has advised the patient to pay 0 for the treatment
Patient submitted the 0 operation fee but not the admit fee 0
从上面,如何提取数字和数字前后的单词并将它们存储在单独的变量中
Expected Results
Var1 Var2
pay 0 for
the 0 operation fee 0
([a-zA-Z]+) *?$?([0-9]+) ?([a-zA-Z]*)