handling large data on single computer if all is wellthe output of this code should be now that we have our hamming distance function in positionwe can use it to find similar customers to given customerand this is exactly what we want our application to do let' move on to the last partutilizing our setup as sort of application step presentation and automation now that we have it all set upour application needs to perform two steps when confronted with given customerlook for similar customers suggest movies the customer has yet to see based on what he or she has already viewed and the viewing history of the similar customers first things firstselect ourselves lucky customer finding similar customer time to perform real-time queries in the following listingcustomer is the happy one who'll get his next movies selected for him but first we need to select customers with similar viewing history listing finding similar customers we do two-step sampling first samplingindex must be exactly the same as the one of the selected customer (is based on moviesselected people must have seen (or not seenthese movies exactly like our customer did second sampling is ranking based on the -bit strings these take into account all the movies in the database pick customer from database customer_id sql "select from movie_comparison where cust_id %scustomer_id cust_data pd read_sql(sql,mcsql ""select cust_id,hammingdistance(bit bit ,bit ,bit ,% ,% ,% ,%sas distance from movie_comparison where bucket '%sor bucket ='%sor bucket ='%sorder by distance limit ""(cust_data bit [ ],cust_data bit [ ]cust_data bit [ ]cust_data bit [ ]cust_data bucket [ ]cust_data bucket [ ],cust_data bucket [ ]shortlist pd read_sql(sql,mcwe show the customers that most resemble customer customer ends up first table shows customers and to be the most similar to customer don' forget that the data was generated randomlyso anyone replicating this example might receive different results now we can finally select movie for customer to watch