user6771469
user6771469

Reputation:

Pandas how to open a csv with emoticons inside

Simple as the title says...

I have a csv that has test with emoticons such as: 💜, 😭, ❄️, etc...

Whenever u try to open the dataframe with pandas method read_csv()

Heading ##ParserError: Error tokenizing data. C error:

I'm sure the error comes when trying to deal with the emoticons because i dont get that message if a rule out the header with emoticons. So... i 've tried with:

error_bad_lines -> wipes out almost every row leaving an empty dataframe.

changing unicode ? yes, done that ! got the same error...

my pandas read_csv line looks like:

df = pd.read_csv(filepath_or_buffer='my.csv', sep=',', encoding ='utf-8', error_bad_lines=False) 

Thank you all !

Upvotes: 1

Views: 956

Answers (1)

user6771469
user6771469

Reputation:

My bad....

The csv had a wrong field separator and columns at each row where disrupted. Just to be sure i opened a csv with tons of emojis and had no problem.

Thank you all.

Upvotes: 1

Related Questions