小编Ath*_*R T的帖子

如何根据多个条件用字符串拆分 Pandas 数据框列

我有一个 Pandas 数据框,如下所示:

    ID       Col.A

28654      This is a dark chocolate which is sweet 
39876      Sky is blue 1234 Sky is cloudy 3423
88776      Stars can be seen in the dark sky
35491      Schools are closed 4568 but shops are open
Run Code Online (Sandbox Code Playgroud)

我试图Col.A在单词darkdigits. 我想要的结果如下。

     ID             Col.A                             Col.B
    
    28654      This is a                  dark chocolate which is sweet 
    39876      Sky is blue                1234 Sky is cloudy 3423
    88776      Stars can be seen in the   dark sky
    35491 …
Run Code Online (Sandbox Code Playgroud)

python regex dataframe pandas

4
推荐指数
2
解决办法
168
查看次数

标签 统计

dataframe ×1

pandas ×1

python ×1

regex ×1