<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _max_form(f, colname):
 """ Assumes dataframe with hierarchical columns with first index equal to the use and second index equal to the attribute. e.g. f.columns equal to:: mixedoffice building_cost building_revenue building_size max_profit max_profit_far total_cost industrial building_cost building_revenue building_size max_profit max_profit_far total_cost """

        df = f.stack(level=0)[[colname]].stack().unstack(level=1).reset_index(level=1, drop=True)
        return df.idxmax(axis=1)