GroupBys seem to be slightly complicating things, because the groupby objects returned when calling df.groupby or series.groupby don't directly call the already overridden series and dataframe functions. So this adds a MicroSeriesGroupBy class which, intruding as little as possible onto existing groupby functionality, intercepts the calls to median, mean, etc. and passes onto the overriden functions. As for dataframes, the df.groupby function now returns a dataframegroupby object, but the internal seriesgroupby objects have been cast to MicroSeriesGroupBy objects so they use weights. This means:
Series groupbys should work as normal (but using weights)
DataFrame groupbys don't entirely work yet:
df.groupby(...)[col] will return a series groupby object, so that works.
df.groupby(...).mean()[col] will work, but won't use weighted functions, because the mean() function returns a DataFrameGroupBy object. We might need to write a MicroDataFrameGroupBy class for this that intercepts the weighted functions like mean, etc.
Should fix #165 , I no longer get any crashes.
GroupBys seem to be slightly complicating things, because the groupby objects returned when calling df.groupby or series.groupby don't directly call the already overridden series and dataframe functions. So this adds a MicroSeriesGroupBy class which, intruding as little as possible onto existing groupby functionality, intercepts the calls to median, mean, etc. and passes onto the overriden functions. As for dataframes, the df.groupby function now returns a dataframegroupby object, but the internal seriesgroupby objects have been cast to MicroSeriesGroupBy objects so they use weights. This means: