def group_function(g):
    return pd.Series([g['is_active'].mean(), g['latitude'].median(), g[
        'longitude'].median(), g['time_'].mean(), your_function(g)], index=
        ['mean_active', 'median_lat', 'median_lon', 'mean_time', 'new_col'])
pandas: how to do multiple groupby-apply operations