title: How to create new row to ensure time series length is equal?
body: <p>I am trying to perform to classify effectiveness of a treatment. Each of the id should contain 4 timeframes.</p>
  <pre><code>Dataframe
  </code></pre>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th style="text-align: left;">id</th>
  <th style="text-align: center;">timeframe</th>
  <th style="text-align: right;">distance</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td style="text-align: left;">1</td>
  <td style="text-align: center;">1</td>
  <td style="text-align: right;">1.1</td>
  </tr>
  <tr>
  <td style="text-align: left;">1</td>
  <td style="text-align: center;">2</td>
  <td style="text-align: right;">1.1</td>
  </tr>
  <tr>
  <td style="text-align: left;">1</td>
  <td style="text-align: center;">3</td>
  <td style="text-align: right;">1.2</td>
  </tr>
  <tr>
  <td style="text-align: left;">1</td>
  <td style="text-align: center;">4</td>
  <td style="text-align: right;">1.1</td>
  </tr>
  <tr>
  <td style="text-align: left;">2</td>
  <td style="text-align: center;">1</td>
  <td style="text-align: right;">1.1</td>
  </tr>
  <tr>
  <td style="text-align: left;">2</td>
  <td style="text-align: center;">2</td>
  <td style="text-align: right;">1.1</td>
  </tr>
  <tr>
  <td style="text-align: left;">2</td>
  <td style="text-align: center;">4</td>
  <td style="text-align: right;">1.1</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>The question is for example id 2 timeframe #3 is missing. How to create a new row added in the missing timeframe with the average distance value for all the rows with such issue?</p>
  <p>I am getting the 'not all time is the same length' when running - Longitudinal clustering using &quot;longitudinal k-means (KML)&quot;</p>