def get_df_transition_probabilities(tm, direction):
    """Create dataframe of transition probabilities for given direction.

    Parameters:
    -----------
        tm: dict
            Dictionary of transition matrices for both directions.

        direction: str
            "origin_to_destination": Column = origin (t), row = destination (t+1)
                - % column (origin) goes to row (destination).
            "destination_to_origin": Column = destination (t), Row = origin (t-1)
                - % column (origin) that came from row (origin).

    Returns:
    --------
        df_trans_probs: pd.DataFrame
            DataFrame consisting of transition probabilities according
            to specified direction.

    """

    df_trans_probs = tm[direction]
    df_trans_probs.columns, df_trans_probs.index = (
        [label.split("_")[0].capitalize() for label in list(df_trans_probs.columns)],
        [label.split("_")[0].capitalize() for label in list(df_trans_probs.index)],
    )

    return df_trans_probs