case study building recommender system inside database listing creating bit strings we represent the string as numeric value the string will be concatenation of zeros ( and ones ( because these indicate whether someone has seen certain movie or not the strings are then regarded as bit code for example is the same as the number what def createnum(doestakes in valuesconcatenates these column values and turns them into stringthen turns the byte code of the string into number def createnum( , , , , , , , )return [int('% % % % % % % % ( , , , , , , , ), for ( , , , , , , , in zip( , , , , , , , )assert int(' ', = assert int(' ', = assert createnum([ , ],[ , ],[ , ],[ , ],[ , ],[ , ],[ , ],[ , ]=[ , store pd dataframe(store['bit 'createnum(data movie data movie ,data movie ,data movie ,data movie data movie ,data movie ,data movie store['bit 'createnum(data movie data movie ,data movie ,data movie ,data movie data movie ,data movie ,data movie store['bit 'createnum(data movie data movie ,data movie ,data movie ,data movie data movie ,data movie ,data movie store['bit 'createnum(data movie data movie ,data movie ,data movie ,data movie data movie ,data movie ,data movie translate the movie column to bit strings in numeric form each bit string represents movies * movies noteyou could use -bit string instead of * to keep the code short test if the function works correctly binary code is the same as (= * + * + * + * if the assert failsit will raise an assert errorotherwise nothing will happen by converting the information of columns into numberswe compressed it for later lookup figure shows what we get when asking for the first observations (customer movie view historyin this new format store[ : the next step is to create the hash functionsbecause they'll enable us to sample the data we'll use to determine whether two customers have similar behavior figure first customersinformation on all movies after bit string to numeric conversion