Replacing part of string in python pandas dataframe

后端 未结 2 1475
隐瞒了意图╮
隐瞒了意图╮ 2020-12-14 07:27

I have a similar problem to the one posted here:

Pandas DataFrame: remove unwanted parts from strings in a column

I need to remove newline characters from w

2条回答
  •  北海茫月
    2020-12-14 07:51

    You could use regex parameter of replace method to achieve that:

    misc['product_desc'] = misc['product_desc'].replace(to_replace='\n', value='', regex=True)
    

提交回复
热议问题