def split_nav_dataframe(nav_table, split_date):
    """
    Split NAV pandas DataFrame into
    a training and a testing DataFrame according to a split_date,
    such that split_date becomes the last date of the
    training DataFrame.

    Args:
        - split_date (datetime.datetime)
    Returns:
        - train: the training DataFrame
        - test:  the testing DataFrame

    """
    assert split_date in nav_table.index.tolist()
    split_index = nav_table.index.tolist().index(split_date)
    train = nav_table.iloc[:split_index + 1]
    test = nav_table.iloc[split_index + 1:]
    return train, test