title: Upsampling a polars dataframe with groupby
body: <p>I'm trying to upsample a Polars dataframe while grouping by a particular column. In the following example, I wish to group by 'fruit' and then upsample by date.</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>fruit</th>
  <th>date</th>
  <th>count</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>apple</td>
  <td>2022-06-01</td>
  <td>5</td>
  </tr>
  <tr>
  <td>apple</td>
  <td>2022-06-03</td>
  <td>6</td>
  </tr>
  <tr>
  <td>apple</td>
  <td>2022-06-04</td>
  <td>2</td>
  </tr>
  <tr>
  <td>apple</td>
  <td>2022-06-07</td>
  <td>1</td>
  </tr>
  <tr>
  <td>pear</td>
  <td>2022-06-01</td>
  <td>9</td>
  </tr>
  <tr>
  <td>pear</td>
  <td>2022-06-07</td>
  <td>12</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>This is what the output should look like:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>fruit</th>
  <th>date</th>
  <th>count</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>apple</td>
  <td>2022-06-01</td>
  <td>5</td>
  </tr>
  <tr>
  <td>apple</td>
  <td>2022-06-02</td>
  <td>5</td>
  </tr>
  <tr>
  <td>apple</td>
  <td>2022-06-03</td>
  <td>6</td>
  </tr>
  <tr>
  <td>apple</td>
  <td>2022-06-04</td>
  <td>2</td>
  </tr>
  <tr>
  <td>apple</td>
  <td>2022-06-05</td>
  <td>2</td>
  </tr>
  <tr>
  <td>apple</td>
  <td>2022-06-06</td>
  <td>2</td>
  </tr>
  <tr>
  <td>apple</td>
  <td>2022-06-07</td>
  <td>1</td>
  </tr>
  <tr>
  <td>pear</td>
  <td>2022-06-01</td>
  <td>9</td>
  </tr>
  <tr>
  <td>pear</td>
  <td>2022-06-02</td>
  <td>9</td>
  </tr>
  <tr>
  <td>pear</td>
  <td>2022-06-03</td>
  <td>9</td>
  </tr>
  <tr>
  <td>pear</td>
  <td>2022-06-04</td>
  <td>9</td>
  </tr>
  <tr>
  <td>pear</td>
  <td>2022-06-05</td>
  <td>9</td>
  </tr>
  <tr>
  <td>pear</td>
  <td>2022-06-06</td>
  <td>9</td>
  </tr>
  <tr>
  <td>pear</td>
  <td>2022-06-07</td>
  <td>12</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>For a non group-by scenario, the following command gets me the result I need:</p>
  <pre><code>df.upsample('date', every='1d').fill_null(&quot;forward&quot;)
  </code></pre>
  <p>However, I've not been able to get it working when a groupby is involved</p>
  <p>ps: here is a similar question, but using pandas - <a href="https://stackoverflow.com/questions/32012012/pandas-resample-timeseries-with-groupby">Pandas: resample timeseries with groupby</a></p>