I have a df with two columns IP address and user id. I am attempting to determine the distinct values across both the user id and the IP addresses. I know how to get a distinct list of users per IP and vis versa, but can't figure out if I wanted them smashed into a single row and how I'd do it.
what's the recommended way to get this result I'm looking for?
Example Data:
| ip_address | user_id |
|---|---|
| 127.0.0.1 | 111 |
| 192.168.1.1 | 111 |
| 127.0.0.1 | 444 |
| 10.10.0.1 | 555 |
| 8.8.8.8 | 666 |
| 8.8.8.8 | 888 |
| 8.8.8.8 | 999 |
| 10.0.0.1 | 777 |
Final Format:
| ip_address | user_id |
|---|---|
| 127.0.0.1, 192.168.1.1 | 111, 444, 555 |
| 8.8.8.8 | 666, 888, 999 |
| 10.0.0.1 | 777 |