Python Pandas to_clipboard() UnicodeEncodeError: 'ascii' codec can't encode character Python Pandas to_clipboard() UnicodeEncodeError: 'ascii' codec can't encode character python-3.x python-3.x

Python Pandas to_clipboard() UnicodeEncodeError: 'ascii' codec can't encode character


df.to_clipboard(df.to_csv(encoding='cp1252'))

just encode it as a csv with the encoding specified then throw it on the clipboard.