Group and aggregate with Code Assist

For this tutorial, we’ll use the Palmer Penguins data. We have already filtered out some records with missing data and selected a subset of columns.

  1. Hover over the assistant icon icon. Select the Transformations item from the popup menu.

    Select the Transformations item
  2. The transformations widget opens. Select the Groupby and aggregate transformation option.

  3. Choose one or more columns to group by. These determine the buckets that the results are allocated to. Generally, you’ll want to select columns with discrete values.

  4. Choose the column to aggregate. Generally, you’ll want to select a column with numeric values.

  5. Select an aggregation function.

    Select an aggregate function
  6. You can add more aggregations. It’s not necessary to choose the same column to aggregate.

  7. Preview the results. Press the RUN button.

  8. The required code is inserted into the notebook and immediately executed.

Code is inserted and executed