Update pandas DataFrame with .str.replace() vs .replace()

前端 未结 2 902
醉话见心
醉话见心 2021-01-21 16:35

I have a column in my pandas Dataframe df that contains a string with some trailing hex-encoded NULLs (\\x00). At least I think that it\'s that. When I tried to replace them wit

2条回答
  •  野性不改
    2021-01-21 16:47

    The former looks for exact matches, the latter looks for matches in any part of the string, which is why the latter works for you.

    The str methods are synonymous with the standard string equivalents but are vectorised

提交回复
热议问题