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

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() { }
This expression appears to be a shortcut
for
But it isn't. maxBy returns a

ReducedGroupByand you need to callintoorvaluesdf_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 whatintoorvaluesdo. For me these functions seem like optional stepsWe can use approach proposed here by @Jolanrensen and make ReducedGroupBy : DataFrame, so you can both use DF api and
into,valueson 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 todf.convert { }.add() { }