Replacing part of string in python pandas dataframe

后端 未结 2 1477
隐瞒了意图╮
隐瞒了意图╮ 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:52

    strip only removes the specified characters at the beginning and end of the string. If you want to remove all \n, you need to use replace.

    misc['product_desc'] = misc['product_desc'].str.replace('\n', '')
    

提交回复
热议问题