Skip to content

Instantly share code, notes, and snippets.

@pawl
Created September 1, 2015 02:17
Show Gist options
  • Save pawl/2aab05de16da3ae153c8 to your computer and use it in GitHub Desktop.
Save pawl/2aab05de16da3ae153c8 to your computer and use it in GitHub Desktop.
pandas
def csv_encode(value, encoding='UTF-8'):
if py3compat.PY3 or not isinstance(value, unicode):
return value
return value.encode(encoding, 'replace')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment