df_extensions/space.py
def join_distance(df_label_dict: Dict[str, pd.DataFrame]) -> pd.DataFrame:
    """
    Expects the results of df.space.self_distance to be put into
    the dataframes in the input
    Will merge multiple kinds of distance into a common dataframe
    the str in the dictionary it expects is the label for the column
    """

    def prepare(df, label):

        return (
            df.set_index(list(df.columns[:2]))
            .rename(columns={"distance": label})
            .drop(columns=["match", "position"], errors="ignore")
        )

    to_join = [prepare(df, label) for label, df in df_label_dict.items()]
    df = reduce(lambda x, y: x.join(y), to_join)
    df = df.reset_index()
    return df

    Expects the results of df.space.self_distance to be put into
    the dataframes in the input
    Will merge multiple kinds of distance into a common dataframe
    the str in the dictionary it expects is the label for the column
    
Expects the results of df.space.self_distance to be put into
the dataframes in the input
Will merge multiple kinds of distance into a common dataframe
the str in the dictionary it expects is the label for the column
Expects the results of df . space . self_distance to be put into the dataframes in the input Will merge multiple kinds of distance into a common dataframe the str in the dictionary it expects is the label for the column
def join_distance(df_label_dict: Dict[str, pd.DataFrame]) -> pd.DataFrame:
    def prepare(df, label):
        return (
            df.set_index(list(df.columns[:2]))
            .rename(columns={"distance": label})
            .drop(columns=["match", "position"], errors="ignore")
        )
    to_join = [prepare(df, label) for label, df in df_label_dict.items()]
    df = reduce(lambda x, y: x.join(y), to_join)
    df = df.reset_index()
    return df
def join_distance ( df_label_dict : Dict [ str , pd . DataFrame ] ) -> pd . DataFrame : def prepare ( df , label ) : return ( df . set_index ( list ( df . columns [ : 2 ] ) ) . rename ( columns = { "distance" : label } ) . drop ( columns = [ "match" , "position" ] , errors = "ignore" ) ) to_join = [ prepare ( df , label ) for label , df in df_label_dict . items ( ) ] df = reduce ( lambda x , y : x . join ( y ) , to_join ) df = df . reset_index ( ) return df
Expects the results of df.space.self_distance to be put into
the dataframes in the input
Will merge multiple kinds of distance into a common dataframe
the str in the dictionary it expects is the label for the column
Expects the results of df . space . self_distance to be put into the dataframes in the input Will merge multiple kinds of distance into a common dataframe the str in the dictionary it expects is the label for the column
"""
    Expects the results of df.space.self_distance to be put into
    the dataframes in the input
    Will merge multiple kinds of distance into a common dataframe
    the str in the dictionary it expects is the label for the column
    """
df_label_dict
Dict[str, pd.DataFrame]