Error with UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf4 in position 1: invalid continuat

I am using python 3.4 version and i have this code but i am trying to figure out how to solve this error.

import pandas as pd

pop = pd.read_csv(“C:/Users/Dell@GL\Desktop/Projects Prototypes/POP.csv”, index_col = 0)

print(pop)

I am receiving this error.

UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0xf4 in position 1: invalid continuat

File “pandas\parser.pyx”, line 766, in pandas.parser.TextReader.read (pandas\parser.c:7988)

Hi,

This appears to be an issue with the Pandas library, not with Bokeh. You will have to contact the Pandas team for assistance, the main Pandas site is here:

  http://pandas.pydata.org/

And has links to mailing lists, issue trackers, etc.

Thanks,

Bryan

···

On Mar 28, 2016, at 1:29 PM, okiror jethro <[email protected]> wrote:

I am using python 3.4 version and i have this code but i am trying to figure out how to solve this error.

import pandas as pd

pop = pd.read_csv("C:/Users/Dell@GL\Desktop/Projects Prototypes/POP.csv", index_col = 0)

print(pop)

I am receiving this error.

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf4 in position 1: invalid continuat

File "pandas\parser.pyx", line 766, in pandas.parser.TextReader.read (pandas\parser.c:7988)

--
You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/c1cc0153-e93b-4ee0-b2e9-eb40965b864e%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

Unicode String types are a handy Python feature that allows you to decode encoded Strings and forget about the encoding until you need to write or transmit the data. Python tries to convert a byte-array (a bytes which it assumes to be a utf-8-encoded string) to a unicode string (str). This process of course is a decoding according to utf-8 rules. When it tries this, it encounters a python byte sequence which is not allowed in utf-8-encoded strings (namely this 0xff at position 0). One simple way to avoid this error is to encode such strings with encode() function as follows (if a is the string with non-ascii character):

a.encode('utf-8').strip()

Or

Use encoding format ISO-8859-1 to solve the issue.