dfply
dfply copied to clipboard
group_by fails to raise exception for missing key
A missing group_by
column does not raise an exception.
In [15]: pd.DataFrame({'a': [1,2,2], 'b': [4,5,6]}) >> group_by('c')
Out[15]:
a b
0 1 4
1 2 5
2 2 6
In dplyr, the equivalent situation raises an error:
library(tidyverse)
> data.frame(a=c(1,2,2), b=c(4,5,6)) %>% group_by(c)
Error in grouped_df_impl(data, unname(vars), drop) :
Column `c` is unknown
My preference would be for this error to raise an exception instead of passing silently.