dataframe icon indicating copy to clipboard operation
dataframe copied to clipboard

add countDistinct on GroupBy

Open devcrocod opened this issue 2 years ago • 3 comments

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 }

devcrocod avatar Dec 09 '23 13:12 devcrocod

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

Jolanrensen avatar Dec 11 '23 10:12 Jolanrensen

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 avatar Dec 11 '23 10:12 devcrocod

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

devcrocod avatar Dec 11 '23 10:12 devcrocod