This is a type of encoding and is used to solve the UnicodeDecodeError, while attempting to read a file in Python or Pandas.
latin-1 is a single-byte encoding which uses the characters 0 through 127, so it can encode half as many characters as latin1. It's a strict subset of both latin1 and utf8, meaning the bytes 0 through 127 in both latin1 and utf8 encode the same things as they do in ASCII.
You can use it like this in pandas:
df = pd.read_csv('filename.csv', encoding='latin1')
Comments
0 comments
Article is closed for comments.