I am following a Machine Learning tutorial (from a text book) and I got stuck on a portion of the code I was given and I am not sure how to proceed. It seems as though I need to change the data type of object to a "bytes-like" as opposed to a string.
I have tried adding a line changing "name" to encode utf-8
for line in data:
if firstLine:
names = line.strip().split(";")
firstLine = False
else:
...
The error I receive:
TypeError: a bytes-like object is required, not 'str'
I am trying to understand why the data-type must be changed, and how I can change it.