Skip to content

Instantly share code, notes, and snippets.

@jazzyjackson
Created September 25, 2017 19:51
Show Gist options
  • Save jazzyjackson/11b1f6c8158067f9a1178a4679ea1b4c to your computer and use it in GitHub Desktop.
Save jazzyjackson/11b1f6c8158067f9a1178a4679ea1b4c to your computer and use it in GitHub Desktop.
## For Python 2
# import codecs
# from future.utils.surrogateescape import register_surrogateescape
# register_surrogateescape()
## Python 2 doesn't have an errors parameter in its global 'open' method, so, import codecs and use codecs.open
# with codecs.open('./youtube_quils_results.csv','r', encoding="utf-8", errors="surrogateescape") as the_file:
with open('./youtube_quils_results.csv','r', encoding="utf-8", errors="surrogateescape") as the_file:
original = pandas.read_csv(the_file, iterator=True, encoding="utf-8")
unsafe_set = set(pandas.read_csv('unsafe_list.csv', header=None, squeeze=True))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment