switch_model/tools/graph/main.py
def load_zone(self, df, load_zone_col="load_zone"):
        """
        Adds a 'region' column that is usually load_zone's state.
        'region' is what comes before the first underscore. If no underscores are present
        defaults to just using the load_zone.
        """
        df = df.copy()  # Don't modify the source
        df["region"] = df[load_zone_col].apply(
            lambda z: z.partition("_")[0]
        )
        return df

        Adds a 'region' column that is usually load_zone's state.
        'region' is what comes before the first underscore. If no underscores are present
        defaults to just using the load_zone.
        
Adds a 'region' column that is usually load_zone's state.
'region' is what comes before the first underscore. If no underscores are present
defaults to just using the load_zone.
Adds a ' region ' column that is usually load_zone ' s state . ' region ' is what comes before the first underscore . If no underscores are present defaults to just using the load_zone .
def load_zone(self, df, load_zone_col="load_zone"):
        df = df.copy()  
        df["region"] = df[load_zone_col].apply(
            lambda z: z.partition("_")[0]
        )
        return df
def load_zone ( self , df , load_zone_col = "load_zone" ) : df = df . copy ( ) df [ "region" ] = df [ load_zone_col ] . apply ( lambda z : z . partition ( "_" ) [ 0 ] ) return df
Adds a 'region' column that is usually load_zone's state.
Adds a ' region ' column that is usually load_zone ' s state .
"""
        Adds a 'region' column that is usually load_zone's state.
        'region' is what comes before the first underscore. If no underscores are present
        defaults to just using the load_zone.
        """ # Don't modify the source
self
df
load_zone_col