Ensuring groupby output type
The pandas docs explain this here: http://pandas.pydata.org/pandas-docs/stable/missing_data.html
NAN's are excluded this is consistent with R.
Earlier versions of Pandas did include them but they have since been removed.