Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

utf-8 and latin-1 won't work while reading a csv file with pandas

I am trying to read a CSV file which includes French characters (like é, à, etc.) and email addresses with pandas.

Encoding with utf-8 gives an error. Encoding with latin-1 eliminates my é.

Any idea what encoding I should use ?

Thanks, Chris

like image 634
Webmax Avatar asked Jan 18 '26 10:01

Webmax


1 Answers

pd.read_csv(csv_file, encoding = 'iso-8859-1')

where 'iso-8859-1' is the encoding needed to properly represent languages from occidental Europe including France

like image 154
BSP Avatar answered Jan 21 '26 07:01

BSP