I\'m running a program which is processing 30,000 similar files. A random number of them are stopping and producing this error...
File "C:\\Importer\\src
Struggled with this a while and thought I'd post on this question as it's the first search result. Adding the encoding="iso-8859-1"
tag to pandas read_csv
didn't work, nor did any other encoding, kept giving a UnicodeDecodeError.
If you're passing a file handle to pd.read_csv(),
you need to put the encoding
attribute on the file open, not in read_csv
. Obvious in hindsight, but a subtle error to track down.