table the most similar customers to customer cust_id distance finding new movie we need to look at movies customer hasn' seen yetbut the nearest customer hasas shown in the following listing this is also good check to see if your distance function worked correctly although this may not be the closest customerit' good match with customer by using the hashed indexesyou've gained enormous speed when querying large databases listing finding an unseen movie cust pd read_sql('select from cust where cust_id in ( , , )',mcdif cust dif[dif[ !dif[ ]select movies transpose for convenience select movies customer didn' see yet customers have seen table shows you can recommend movie or based on customer ' behavior table movies from customer can be used as suggestions for customer cust_id movie movie movie movie movie movie movie movie