Dear Mentors:
In Exercise 10 of the assignment for Week 4, I got stuck again.
In the for-loop to store the index and vectors in ‘vecs,’
I encountered the error below.
TypeError: object of type 'int' has no len()
The problematic part of my code is:
id_table[h] = i
I still don’t understand what dimension this list should have.
I actually initialized both the hash table and the id table as follows:
hash_table = {i:[] for i in range(num_buckets)}
id_table = {i:[] for i in range(num_buckets)}
However, due to the enumeration of ‘vecs’ in the for-loop,
The dimensions of hash_table and id_table will differ from each other.
How can I solve this problem?
Please give me some advice.
Best wishes,
Setsuro