PAT['HFZ'].replace('1','HFZ',inplace=True)
^ This is the code I'm dealing with
I want to change '1' to 'HFZ'
I tried to do it but an error accrue
PAT['HFZ'].replace('1','HFZ',inplace=True)
^ This is the code I'm dealing with
I want to change '1' to 'HFZ'
I tried to do it but an error accrue
In case you have a Pandas dataframe, the easiest way to do it is the following:
df['range'].replace(',','-',inplace=True)
Which I understand it is what you tried. If it does not replace what you are trying to replace is because str values do not match and no replacement occurs.
According to the docs we see this description:
str or regex: str: string exactly matching to_replace will be replaced with value