title: how to calculate co-occurence with data.table
body: <p>I have a verge large transaction data ，
  looks like:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>transactionid</th>
  <th>items</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>1</td>
  <td>i1</td>
  </tr>
  <tr>
  <td>1</td>
  <td>i2</td>
  </tr>
  <tr>
  <td>2</td>
  <td>i3</td>
  </tr>
  <tr>
  <td>2</td>
  <td>i1</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>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</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th></th>
  <th>i1</th>
  <th>i2</th>
  <th>i3</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>i1</td>
  <td>0</td>
  <td>1</td>
  <td>1</td>
  </tr>
  <tr>
  <td>i2</td>
  <td>1</td>
  <td>0</td>
  <td>0</td>
  </tr>
  <tr>
  <td>i3</td>
  <td>1</td>
  <td>0</td>
  <td>0</td>
  </tr>
  </tbody>
  </table>
  </div>