title: Create column from all possible combination of two columns in dataframe based on groupby in Python
body: <p>I have a dataframe in like below</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>id</th>
  <th>group</th>
  <th>log</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>10</td>
  <td>UU1Q</td>
  <td>23</td>
  </tr>
  <tr>
  <td>10</td>
  <td>UU1Q</td>
  <td>12</td>
  </tr>
  <tr>
  <td>10</td>
  <td>UU2Q</td>
  <td>15</td>
  </tr>
  <tr>
  <td>11</td>
  <td>UU2Q</td>
  <td>17</td>
  </tr>
  <tr>
  <td>11</td>
  <td>UU3Q</td>
  <td>35.6</td>
  </tr>
  <tr>
  <td>11</td>
  <td>UU1Q</td>
  <td>29.8</td>
  </tr>
  <tr>
  <td>11</td>
  <td>UU1Q</td>
  <td>33</td>
  </tr>
  <tr>
  <td>11</td>
  <td>UU1Q</td>
  <td>44</td>
  </tr>
  <tr>
  <td>13</td>
  <td>UU2Q</td>
  <td>17.77</td>
  </tr>
  <tr>
  <td>13</td>
  <td>UU2Q</td>
  <td>19.90</td>
  </tr>
  <tr>
  <td>13</td>
  <td>UU2Q</td>
  <td>55</td>
  </tr>
  <tr>
  <td>14</td>
  <td>UU3Q</td>
  <td>33</td>
  </tr>
  <tr>
  <td>15</td>
  <td>UU3Q</td>
  <td>22</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>For Each ID and group I want to create all possible combination of log values present in the dataframe in a new column.
  <strong>Desired Output</strong></p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>id</th>
  <th>group</th>
  <th>log</th>
  <th>new_col</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>10</td>
  <td>UU1Q</td>
  <td>23</td>
  <td>(23,23)</td>
  </tr>
  <tr>
  <td>10</td>
  <td>UU1Q</td>
  <td>12</td>
  <td>(23,12)</td>
  </tr>
  <tr>
  <td>10</td>
  <td>UU2Q</td>
  <td>15</td>
  <td>(15,15)</td>
  </tr>
  <tr>
  <td>11</td>
  <td>UU2Q</td>
  <td>17</td>
  <td>(17,17)</td>
  </tr>
  <tr>
  <td>11</td>
  <td>UU3Q</td>
  <td>35.6</td>
  <td>(35.6,35.6)</td>
  </tr>
  <tr>
  <td>11</td>
  <td>UU1Q</td>
  <td>29.8</td>
  <td>(29.8, 29.8)</td>
  </tr>
  <tr>
  <td>11</td>
  <td>UU1Q</td>
  <td>33</td>
  <td>(29.8,33)</td>
  </tr>
  <tr>
  <td>11</td>
  <td>UU1Q</td>
  <td>44</td>
  <td>(29.8,44)</td>
  </tr>
  <tr>
  <td>11</td>
  <td>UU1Q</td>
  <td></td>
  <td>(33,44)</td>
  </tr>
  <tr>
  <td>13</td>
  <td>UU2Q</td>
  <td>17.77</td>
  <td>(17.77,17.77)</td>
  </tr>
  <tr>
  <td>13</td>
  <td>UU2Q</td>
  <td>19.90</td>
  <td>(17.77,19.90)</td>
  </tr>
  <tr>
  <td>13</td>
  <td>UU2Q</td>
  <td>55</td>
  <td>(17.77,55)</td>
  </tr>
  <tr>
  <td>13</td>
  <td>UU2Q</td>
  <td></td>
  <td>(19.90,55)</td>
  </tr>
  <tr>
  <td>14</td>
  <td>UU3Q</td>
  <td>33</td>
  <td>(33,33)</td>
  </tr>
  <tr>
  <td>15</td>
  <td>UU3Q</td>
  <td>22</td>
  <td>(22,22)</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>I used shift function but it is only generating combinations with next matching cell. I want to get all the possible combination in each group.<br>
  <code>dummy['new'] = dummy.groupby(['ID', 'group'])['log'].shift()</code></p>