Unsupervised learning, Recommender systems, week 2, practice lab 2 error

Good Day!
I am having issues writing the code for implementing the function for finding similar movies in the practice lab, Deep learning for content based filtering. It says : unsupported format string passed to numpy.ndarray.format
What do I do, please?

Hi @Jose11 , is it the sq_dist function? You should add more info so that the mentors can help. A screenshot of the error traceback too.

1 Like

Yes! The exercise 2
I tried using a for loop and ended up probably with many errors and the rest of the function did not serve as it should go.
Screenshots are attached.

Take a close look at your code in the first image.

There are at least two separate problems:

  • In range(*n), what does the * do?

  • You have two for-loops. The first one does nothing useful, because it sets some values in ‘v’, but then it doesn’t use them.

  • Bonus problem. In the last statement where you use np.square(). You have a space before the (. That’s bad Python syntax.

Unless you have some Python programming skills, I recommend you take an introduction course in Python before you continue much farther.

Also a reminder, please don’t post your code on the forum. That’s not allowed by the Code of Conduct.

If a mentor needs to see your code, we’ll contact you with instructions.

Thank you very much!