I have a DataFrame like this for 70581 rows
id created_at ... resource_id
230789 2017-01-19 ... 490
230722 2017-01-19 ... 514
... ... ... ...
312341 2017-08-27 ... 551
I want to get all possible pairs of resource_id column. If pair is repeated I want to increment the counter of a pair by 1. Result may be something like: (490,514) count 5.
I've tried to use list(itertools.combinations(df['resource_id'],2))
to get the pairs, but instead got MemoryError.
How can I get what I want?