@@ -11,7 +11,6 @@ import org.jetbrains.kotlinx.dataframe.annotations.Interpretable
1111import org.jetbrains.kotlinx.dataframe.annotations.Refine
1212import org.jetbrains.kotlinx.dataframe.columns.FrameColumn
1313import org.jetbrains.kotlinx.dataframe.columns.toColumnSet
14- import org.jetbrains.kotlinx.dataframe.impl.GroupByImpl
1514import org.jetbrains.kotlinx.dataframe.impl.aggregation.PivotImpl
1615import org.jetbrains.kotlinx.dataframe.impl.api.getPivotColumnPaths
1716import org.jetbrains.kotlinx.dataframe.impl.api.groupByImpl
@@ -85,24 +84,17 @@ public interface GroupBy<out T, out G> : Grouped<G> {
8584
8685 public fun filter (predicate : GroupedRowFilter <T , G >): GroupBy <T , G >
8786
87+ @Refine
88+ @Interpretable(" GroupByToDataFrame" )
89+ public fun toDataFrame (groupedColumnName : String? = null): DataFrame <T >
90+
8891 public data class Entry <T , G >(val key : DataRow <T >, val group : DataFrame <G >)
8992
9093 public companion object {
9194 internal val groupedColumnAccessor = column<AnyFrame >(" group" )
9295 }
9396}
9497
95- @Refine
96- @Interpretable(" GroupByToDataFrame" )
97- public fun <T , G > GroupBy <T , G >.toDataFrame (groupedColumnName : String? = null): DataFrame <T > =
98- if (groupedColumnName == null || groupedColumnName == groups.name()) {
99- internal().df
100- } else {
101- internal().df.rename(groups).into(groupedColumnName)
102- }
103-
104- internal fun <T , G > GroupBy <T , G >.internal (): GroupByImpl <T , G > = this as GroupByImpl <T , G >
105-
10698public interface Grouped <out T > : Aggregatable <T >
10799
108100public class ReducedGroupBy <T , G >(
0 commit comments