ElementsOfDataScience icon indicating copy to clipboard operation
ElementsOfDataScience copied to clipboard

04_loops : UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 619: character maps to <undefined>

Open fornoj opened this issue 3 years ago • 1 comments

The encoding on my windows computer is 'cp1252'. When I execute the following cell of the 04_loops notebook: fp = open('2600-0.txt') count = 0 for line in fp: count += 1

I get the following error: UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 619: character maps to <undefined>

I executed the notebook on local and not on colab The issue is solved with encoding='utf8'

fornoj avatar Feb 18 '22 21:02 fornoj

Will fix. Thanks!

AllenDowney avatar Feb 18 '22 22:02 AllenDowney