I am reading headers of csv files from a folder.
code:
#mypath = folder directory with the csv files
for each_file in listdir(mypath):
with open(mypath +"//"+each_file) as f:
first_line = f.readline().strip().split(",")
Error:
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 3131: invalid start byte
Environment:
Spyder, Python 3
Not able to understand the encoding error since I have not done any encoding.