Speaking afraid of people joke, I found today python
in 字符串替换操作
, that string.replace()
can be used 正则表达式
in.
Before, my code is worded as follows, clumsy:
Since the discovery of 正则表达式
the also take effect, the code becomes elegantly simple:
Note: the above figure base_info
is pandas
in the dataframe
data structure, the method described above can be used string
in the replace
method.