def age_pivot_table(age_df):
    """Construct example pivot table for mother's age data."""
    # Group by heiarchical sorting.
    age_pivot_ser = age_df.groupby(by=['year', 'county', 'age',
                                       'weight_indicator'
                                       ]
                                   ).birth_count.sum()

    # Unstack Series to create DataFrame.
    age_pivot_df = age_pivot_ser.unstack()

    return age_pivot_df