def make_name_dict(df, ranks):
    """
    Creates a dictionary of taxids to taxonomy names, including Unclassified
    ranks

    Parameters
    ----------
    df: pandas.DataFrame
        Lineage dataframe
    ranks: list
        Ranks to store names information for

    Returns
    -------
    name_dict: dict
        Name dictionary mapping taxonomy ids to names
    """

    name_dict = {}
    for rank in ranks:
        name_dict.update(
            dict(zip(df[rank].values, df["{}.name".format(rank)].values)))
        name_dict.update(dict(
            zip(-abs(df[rank]), "Unclassified." + df["{}.name".format(rank)])))
    name_dict[-1] = "Unclassified"
    return name_dict