I am aware of combine(groupby(df, :A), nrow=>:count) to count the number of rows for different :A. However, what should be the correct implementation to get the number of unique values of :B for different :A? Basically, I am looking for the counterpart for R: df %>% group_by(A) %>% summarize(n_unique = n_distinct(B)). Thanks!