def priority_from_limit(limit_matrix):
    """
    Calculates the priority from a limit matrix, i.e. sums columns and divides by the number of
    columns.

    :param limit_matrix: The matrix to extract the priority from

    :return: 1d numpy array of the priority
    """
    rval = limit_matrix.sum(axis=1)
    adiv = sum(rval)
    if adiv != 0:
        rval /= adiv
    return rval
