how can I match all the key value pair in python which running too long
问题 User-item affinity and recommendations : I am creating a table which suggests "customers who bought this item also bought algorithm " Input dataset productId userId Prod1 a Prod1 b Prod1 c Prod1 d prod2 b prod2 c prod2 a prod2 b prod3 c prod3 a prod3 d prod3 c prod4 a prod4 b prod4 d prod4 a prod5 d prod5 a Output required Product1 Product2 score Prod1 prod3 Prod1 prod4 Prod1 prod5 prod2 Prod1 prod2 prod3 prod2 prod4 prod2 prod5 prod3 Prod1 prod3 prod2 Using code : #Get list of unique items