Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. Data Science
  3. Question
Data Science

How to resolve the typeerror: unhashable type: 'numpy.ndarray'?

Asked by David Piper Feb 14, 2023 1.5K views 1 answer
Share

About this question

 I'm trying to do a majority voting of the predictions of two deep learning models.The shape of both y_pred and vgg16_y_pred are (200,1) and type 'int64'.

max_voting_pred = np.array([])
for i in range(0,len(X_test)):
    max_voting_pred = np.append(max_voting_pred, statistics.mode([y_pred[i], vgg16_y_pred[i]])) 
I run into the following error:

TypeError: unhashable type: 'numpy.ndarray' How should I pass the data?


Your answer

1 Answer

More Data Science discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest Data Science Blogs

Guides, tips and career advice on Data Science from JanBask experts.