allow an empty data frame to be grouped, with 0 groups. closes #483