从d上移除逃生和换行符

2024-09-27 00:20:29 发布

您现在位置:Python中文网/ 问答频道 /正文

我有一个带有一堆混乱文本数据的df。它看起来像这样:

name                    email
John Doe                jdoe@gmail.com
Anthony Fiorella\nPhD   afiorella@gmail.com
Xu "Chris" Chang        xcchang@hotmail.com

我尝试了一些方法来删除转义字符,比如

df = df.replace(r'\\n',' ', regex=True) 

但到目前为止,一切都不起作用


Tags: 数据name文本comdfemailjohngmail

热门问题