def normalise_activity_by_sector_month(
    topic_activity, sector_month_labels, sector_variable="sector"
):
    """Normalise s.t. each [sector, month] sums to 1."""

    norm_factor = (
        sector_month_labels.dropna()
        .groupby(
            [
                "month",
                sector_variable,
            ]
        )
        .size()
        .sort_index()
    )

    # Each sector sums to 1
    return topic_activity.reorder_levels(["month", sector_variable]).divide(
        norm_factor.reorder_levels(["month", sector_variable]), axis="rows"
    )