Why can't pandas read this text file for data? 'invalid start byte

Viewed 20

Heyo smart peeps, I am trying to use pandas to read this text file, but I keep getting the following error message:

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb0 in position 2988: invalid start byte

My code is:

import pandas as pd

#df = pd.read_csv("PS.prg1903-001_KSK_LB__0_00001.txt")
 
#df = pd.read_csv("PS.prg1903-001_KSK_LB__0_00001.txt", encoding="ISO-8859-1")

df = pd.read_csv("PS.prg1903-001_KSK_LB__0_00001.txt", encoding="latin1")
 
print(df)

I really don't want to use a simple read function, as I have no idea how to convert a list of numbers as strings into a table. Also, the three df functions are all different things I have tried, but all gave the same error. I will also attach a sample of what the data looks like. Thank you to anyone who gives this a read!

Link to sample data!

0 Answers
Related