• Register
0 votes

Problem :

Getting bellow error while executing numpy arrays
unicodedecodeerror: 'ascii' codec can't decode byte 0x90 in position 614: ordinal not in range(128)
6 5 3
6,930 points

Please log in or register to answer this question.

1 Answer

0 votes

Solution :

I had the similar error in the past but bellow code worked for me. 

Note : The encoding='latin1' is the most important part.

# read in data from pickle file created with Load_Data.py
pickle_file = 'mnist.pkl'
with open(pickle_file, 'rb') as f:
    train_set, valid_set, test_set = pickle.load(f, encoding='latin1')

Further Readings:

9 7 4
38,600 points

Related questions

0 votes
1 answer 502 views
Problem : Please find below my code for your reference. import os for root, dirs, files in os.walk('Path'):      for file in files:          if file.endswith('.c'):              with open(os.path.join(root, file)) as f:                     for line in f: ... already tried setting it with the open(os.path.join(root, file),'r',encoding='cp932') as f: but got the same above error
asked Jan 31, 2020 jwilliam 3.9k points
0 votes
1 answer 1.8K views
Problem : I am new to the Python, I am using Python-2.6 CGI scripts but facing following error in the server log while I was doing json.dumps(), Traceback (most recent call last): File "/etc/mongodb/server/cgi-bin/getstats.py", line 135, in <module> print json.dumps ... = datetime.datetime.strftime(now, '%Y-%m-%dT%H:%M:%S.%fZ') print json.dumps({'current_time': now}) // I guess this is the culprit
asked Nov 24, 2019 alecxe 7.5k points
0 votes
2 answers 6.6K views
Problem : I have encountered the following error while compiling "process.py" python tools/process.py --input_dir data -- operation resize --outp ut_dir data2/resize data/0.jpg -> data2/resize/0.png Traceback (most recent call last): File "tools/process.py", line 235, in <module ... 0xff in position 0: invalid start byte What may be the cause of the error? I am using Python's version as 3.5.2.
asked Nov 22, 2019 peterlaw 6.9k points
0 votes
2 answers 423 views
Problem : I want to read my .csv file into Python (Spyder) but I am facing the error. Please find below my code : import csv mydata = open("C:\Users\miche\Documents\school\jaar2\MIK\2.6\vektis_agb_zorgverlener") mydata = csv.reader(mydata) print(mydata) I face the following error: SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape
asked Dec 6, 2019 alecxe 7.5k points
0 votes
1 answer 53 views
Problem : I am new to python. I have tried to install below softwares: Python 2.5.4, Numpy 1.5.0 win32, Matplotlib 1.0.0 win32, pywin32 218. After doing so much of hard work I am still unable to plot the graphs in Python. I am facing ... > from matplotlib._path import affine_transform ImportError: DLL load failed: The specified module could not be found. Can somebody help me in fixing this error?
asked Feb 22, 2020 mphil 2.3k points
0 votes
1 answer 2.2K views
Problem : I have the two DataFrames which I would want to merge. I have referred many documents and also tried to perform many operations but I am not sure what to do now. Please find my two DataFrames as below: DataFrame1: id name type currency 0 BTTA.S Apple ... here I met with the exception as below : ValueError: can not merge DataFrame with instance of type <class 'pandas.core.series.Series'>
asked Dec 24, 2019 alecxe 7.5k points
0 votes
1 answer 26 views
Problems I am trying to update selected datetime64 values in a pandas data frame using the loc method to select rows satisfying a condition. However, instead of assigning the new date-time value it results in NaT. Here is a simplification of my code that shows the problem: ... as the second element in the new_date column. Any ideas on how this should be done or why this is not working as intended?
asked Sep 15, 2020 Marivoke 530 points
0 votes
1 answer 1.5K views
Problem : I am finding solution on following issue deprecationwarning: elementwise == comparison failed; this will raise an error in the future.
asked Nov 15, 2019 peterlaw 6.9k points
0 votes
1 answer 5 views
Problem: At the bottom of the code you have to add these lines: simFlips(100,100) show() Here is the error that I get when I run it on ubuntu: Traceback (most recent call last): File "coin.py", line 36, in <module> simFlips(100,100) File "coin.py", ... (heads - tails)) AttributeError: 'numpy.ndarray' object has no attribute 'append' Please tell me what I'm doing wrong that gives me the last error
asked Jan 11 Mashhoodch 5.6k points
0 votes
1 answer 2 views
Problem: I know there is a ton of these threads but all of them are for very simple cases like 3x3 matrices and things of that sort and the solutions do not even begin to apply to my situation. So I'm trying to graph G versus l1 (that's not an eleven, but an ... 250 data points. I had another user (shout out to Hugh Bothwell!) help me with an error in my code, but now another error has surfaced.
asked Jan 6 Mashhoodch 5.6k points