I have the following code:
import pandas as pd x = [u\'string with some unicode: \\x16\'] df = pd.DataFrame(x)
If I try to write this datafram
Use this to remove any error that you might be getting. You can save to excel post this.
df = df.applymap(lambda x: x.encode('unicode_escape'). decode('utf-8') if isinstance(x, str) else x)