To fix UnicodeDecodeError when reading CSV file in Pandas with Python, we call read_csv
with engine
set to 'python'
.
For instance, we write
import pandas as pd
df = pd.read_csv('file_name.csv', engine='python')
to call read_csv
with the file path of the CSV and engine
set to 'python'
to use the Python native CSV parser to parse the CSV.