df_extensions/space.py
def local_rankings(self):
        """
        add a position column that indicates the relative similarity based on distance
        """
        df = self._obj

        def get_position(df):
            df["position"] = df["distance"].rank(method="first")
            return df

        return (
            df.groupby(df.columns[0], as_index=False)
            .apply(get_position)
            .reset_index(drop=True)
        )

        add a position column that indicates the relative similarity based on distance
        
add a position column that indicates the relative similarity based on distance
add a position column that indicates the relative similarity based on distance
def local_rankings(self):
        df = self._obj
        def get_position(df):
            df["position"] = df["distance"].rank(method="first")
            return df
        return (
            df.groupby(df.columns[0], as_index=False)
            .apply(get_position)
            .reset_index(drop=True)
        )
def local_rankings ( self ) : df = self . _obj def get_position ( df ) : df [ "position" ] = df [ "distance" ] . rank ( method = "first" ) return df return ( df . groupby ( df . columns [ 0 ] , as_index = False ) . apply ( get_position ) . reset_index ( drop = True ) )
add a position column that indicates the relative similarity based on distance
add a position column that indicates the relative similarity based on distance
"""
        add a position column that indicates the relative similarity based on distance
        """
self