wesm/pandas — Issue #618: allow for groupby to handle missing groups (or at least spit meaningfull error)
Author: yarikoptic
Created: 2012-01-12 17:28:30+00:00
State: open

I have tried to find related issue but failed... so pardon me if it is a duplicate:

ATM if groupping doesn't result in actually all possible combinations, the pandas spits out non-informative

```
/home/yoh/deb/gits/pkg-exppsy/pandas/pandas/core/groupby.py in _aggregate_series_pure_python(self, obj, func, ngroups)
431 raise ValueError('function does not reduce')
432
--> 433 counts[label] = group.shape[0]
434 result[label] = res
435

IndexError: index out of bounds
> /home/yoh/deb/gits/pkg-exppsy/pandas/pandas/core/groupby.py(433)_aggregate_series_pure_python()
432
--> 433 counts[label] = group.shape[0]
434 result[label] = res
```

imho there could be an option to still handle those but place NaNs for those entries, OR at least spit out an informative exception something like "combination f1='x', f2='y' doesn't have data entries in the original data, or smth like that