0

I have a DataFrame that looks like this:

username  45michael  7762hc  adrian12  alicia7   
product                                                                                       
63767           0.0     0.0       0.0      0.0           
76863           1.0     0.0       0.0      0.0        
84325           0.0     0.0       0.0      0.0         
86217           0.0     0.0       0.0      1.0  

I'm trying to perform KNN on it and return recommendations given a product id, my question is how can I select an item in the DataFrame by product (i.e: I want product 84325), I mean, how can I get the index position of that item to pass it into the function. So for item 84325 I want to get 2.

0 Answers0