Reputation: 43
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
Upvotes: 3
Views: 10492
Reputation: 775
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
Upvotes: 5
Reputation: 4482
Try the following
#! /usr/bin/python
# coding: utf-8
import pandas
file_content = open('some_file.csv')
data = pandas.read_csv(file_content, encoding='utf-8', quotechar='"',
delimiter=';')
Upvotes: 0