def to_compact(dataframe):
    """to_compact() converts a dataframe that is in canonical form into a compact form

    :param dataframe:
    :return: dataframe

    """

    data = dataframe.drop(['From'], axis=1)
    data.rename(columns={'To': 'State'}, inplace=True)

    return data