Kotlin / dataframe

Structured data processing in Kotlin
https://kotlin.github.io/dataframe/overview.html
Apache License 2.0
784 stars 50 forks source link

add countDistinct on GroupBy #533

Open devcrocod opened 7 months ago

devcrocod commented 7 months ago

I would like to have a function countDistinct() on grouped dataframe for counting distinct values by group

df.groupBy { column_0 }.countDistinct()
df.groupBy { column_0 }.countDistinct { column_1 }
Jolanrensen commented 7 months ago

but then it should probably be named countDistinctValues() right?

devcrocod commented 7 months ago

No, it's similar https://kotlin.github.io/dataframe/countdistinct.html but on grouped df. I wouldn't like the naming to become more complicated

devcrocod commented 7 months ago

this is similar to other functions that apply to both a dataframe and a grouped dataframe: count, sum, mean ...