def groupby_asdf(df, grouped, idx=0):
    """
    Returns pandas DataFrame as a subset from df with given index idx in
    the grouped

    Parameters
    ----------
    df: pandas DataFrame
    grouped: pandas GroupBy object based on df
    idx: group index in grouped

    Returns
    -------
    pandas DataFrame as a subset from df in the grouped with a given index idx

    """

    start = grouped.groups[idx][0]
    end = grouped.groups[idx][-1]
    return df[start:end]