Skip to content

toString of grouped data-frames should include variables, number of groups, and number of records #234

Description

@holgerbrandl

In R's toString implementation of grouped data-frames, the grouping attributes are displayed along with the complete table structure providing a much more informative view:

> iris %>% group_by(Species)
# A tibble: 150 x 5
# Groups:   Species [3]
   Sepal.Length Sepal.Width Petal.Length Petal.Width Species
          <dbl>       <dbl>        <dbl>       <dbl> <fct>
 1          5.1         3.5          1.4         0.2 setosa
 2          4.9         3            1.4         0.2 setosa

In comparison, with kdf we can hardly imagine what's behind a grouped data-frame (making subsequent aggregations and transformation harder to work out interactively)

> irisData.groupBy("Species").print()
      Species    group
 0     setosa [50 x 5]
 1 versicolor [50 x 5]
 2  virginica [50 x 5]

Expected: A grouped-df should render the same as an ungrouped table, but with additional information about the grouping attributes and the number of groups.

See https://dplyr.tidyverse.org/reference/group_by.html#ref-examples

Metadata

Metadata

Assignees

Labels

APIIf it touches our APIenhancementNew feature or request

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions