[英]Replace \x00\x00\x00 to empty in a dataframe
I have one dataframe, there is one column, some rows contain '\x00\x00\x00'.我有一个 dataframe,有一列,有些行包含 '\x00\x00\x00'。 I'd like to replace to empty.
我想更换为空。 My code is like this:
我的代码是这样的:
df.loc[df['column1']=='\x00\x00\x00','column1'] = ''
After that, when print this column, it's still same, no changes.之后打印这个专栏,还是一样,没有变化。
Any suggestion?有什么建议吗?
Would this work?这行得通吗?
df['column1']=df['column1'].str.replace('\x00\x00\x00','')
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.