Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UnicodeDecodeError: 'ascii' codec can't decode byte 0xc1 in position 2: ordinal not in range(128) #3

Open
flaviomb opened this issue Feb 28, 2018 · 4 comments

Comments

@flaviomb
Copy link

flaviomb commented Feb 28, 2018

I have tried to run this example but I have found some problems.

First, when I run the command import cPickle I have got the following error:

ImportError: No module named 'cPickle'

Searching on the web, I found this command: import _pickle as cPickle and the error ImportError: No module named 'cPickle' disappears.

However, when I run the first command Xd = cPickle.load(open("RML2016.10a.dat",'rb')) again the following error appears:

Traceback (most recent call last): File "<ipython-input-42-221bdee5fae3>", line 1, in <module> Xd = cPickle.load(open("RML2016.10a.dat",'rb')) UnicodeDecodeError: 'ascii' codec can't decode byte 0xc1 in position 2: ordinal not in range(128)

My python version is 3.4.3

What is the cause of this UnicodeDecodeError?

Thanks for the attention.

@pachpandepriti
Copy link

Did u solve this error?

@Iamshg
Copy link

Iamshg commented May 12, 2018

xd = cPickle.load(open(filename,'rb'),encoding='latin')

@zhw0211
Copy link

zhw0211 commented May 7, 2019

this dataset was made in python2 ,but you want to open it in python3 ,so you got these problems

@JJH-JJH-JJH
Copy link

You should use pickle instead of cPickle

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants