'Find users with common contents and display the content not associated to the user but viewed from other users with common contents [duplicate]
I have a pandas data frame, as for the following:
| Content | User |
| -------- | -------------- |
| x | A |
| y | B |
| x | B |
| z | C |
| x | C |
I would like to find all users with the same content, as for:
| Content | User |
| -------- | -------------- |
| x | [A, B, C] |
| y | [ B ] |
| z | [ C ] |
and then recommend the content not associated yet to the user but already viewed from users with common content:
> A -> y, z
>
> B -> z
>
> C -> y
Thanks
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
