lukas / ml-class

Machine learning lessons and teaching projects designed for engineers
https://www.youtube.com/channel/UCBp3w4DCEC64FZr4k9ROxig
GNU General Public License v2.0
2.34k stars 1.17k forks source link

data-prep.py (specify encoder in open statements) #29

Closed nikohartline closed 4 years ago

nikohartline commented 6 years ago

When the default encoder is not set to utf8, the data-prep.py code errors out. Might help for future classes to have the option specified.

with open("train.csv", "w") as f:

change to:

with open("train.csv", "w",encoding="utf8") as f:

note that there are 6 instances of open where adding the encoding statement should help!

Lines with issue: