def multicols(df, names, how='all'):
    """Returns list of columns in a DataFrame which contain the substring name,
    even for heirarchical columns, for example:
        multicols(df, 'group A')
        [('group A', 'result 1'), ('group A', 'result 2')]
    """
    def colsearch(col, names, how):
        if how == 'all':
            h = all
        else:
            h = any
        if type(names) == str:
            names = [names]
        return h([any([name in subcol for subcol in col]) for name in names])
    return [col for col in df.columns if colsearch(col, names, how)]