I have a verge large transaction data , looks like:
| transactionid | items |
|---|---|
| 1 | i1 |
| 1 | i2 |
| 2 | i3 |
| 2 | i1 |
how to calculate co-occurence matrix with data.table or python ps: the ordinary methods doesn't work since the big data the expected output is
| i1 | i2 | i3 | |
|---|---|---|---|
| i1 | 0 | 1 | 1 |
| i2 | 1 | 0 | 0 |
| i3 | 1 | 0 | 0 |