def filter_intensity(df, label="", with_multiplicity=False):
    """
    Filter to include only the Intensity values with optional specified label, excluding other 
    Intensity measurements, but retaining all other columns.
    """
    label += ".*__\d" if with_multiplicity else ""

    dft = df.filter(regex="^(?!Intensity).*$")
    dfi = df.filter(regex='^(.*Intensity.*%s.*__\d)$' % label)

    return pd.concat([dft,dfi], axis=1)
def filter_intensity ( df , label = "" , with_multiplicity = False ) : label += ".*__\d" if with_multiplicity else "" dft = df . filter ( regex = "^(?!Intensity).*$" ) dfi = df . filter ( regex = '^(.*Intensity.*%s.*__\d)$' % label ) return pd . concat ( [ dft , dfi ] , axis = 1 )
Filter to include only the Intensity values with optional specified label, excluding other 
    Intensity measurements, but retaining all other columns.