I downloaded a text file on my Macbook, I believe my code is correct and there are no errors in the spelling of the file. This is my code
Mydata=r'/Users/janetnorio/Desktop/CylindricalRollerBearingData_01.txt'
with open(Mydata, 'r') as Datafile:
Datafile.readline()
Datafile.readline()
Units=Datafile.readline().split('\t')
and the code prints the following
Traceback (most recent call last):
File "/Applications/Python 3.7/Homework assignments and other /Python_project01.py", line 7, in <module>
Datafile.readline()
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/codecs.py", line 322, in decode
(result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe0 in position 24: invalid continuation byte
Can someone tell me what is wrong?