In my input data, it seems when the logger with which the data were collected runs on low power, it introduces some special characters, like "v" or "@".
I loaded the dataset with pandas read_csv(engine='python'). I had to use engine='python' otherwise I got an error message:
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 2: invalid start byte
I found how to exclude special characters from a pandas dataframe:
df.var_a = df.var_a.str.replace('[#,@,&,�,{,v,?]','')
This replaces special characters like "@" with "", but I have also this special character in the dataframe "\x" and I can't remove it with the code shown above, I get this error message:
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 24-25: truncated \xXX escape
How can I remove "\x" from a pandas dataframe?