Skip to content

Make ReducedGroupBy implement DataFrame interface #778

Description

@koperagen

This expression appears to be a shortcut

df_3.groupBy { year }.maxBy { gflops.toDouble() }

for

df_3.groupBy { year }.aggregate { 
    maxBy { gflops.toDouble() }
}

But it isn't. maxBy returns a ReducedGroupBy and you need to call into or values df_3.groupBy { year }.maxBy { gflops.toDouble() }.values(). I always found it to be confusing. Before you can work with data as it appears in the table, you need to figure out what into or values do. For me these functions seem like optional steps
image

We can use approach proposed here by @Jolanrensen and make ReducedGroupBy : DataFrame, so you can both use DF api and into, values on the object. See if it worth it for ReducedPivot and ReducedPivotGroupBy too. I wouldn't go as far as implementing it for all intermediate objects though because there all steps are mandatory. It doesn't make sense to df.convert { }.add() { }

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions