def apply_function_on_axis_dataframe(df, func, axis=0):
    """Apply a function on a row/column basis of a DataFrame.
    
    Args:
        df (pd.DataFrame): Dataframe.
        func (function): The function to apply.
        axis (int): The axis of application (0=columns, 1=rows).
    
    Returns:
        pd.DataFrame: Dataframe with the applied function.
    
    Examples:
        >>> df = pd.DataFrame(np.array(range(12)).reshape(4, 3), columns=list('abc'))
        >>> f = lambda x: x.max() - x.min()
        >>> apply_function_on_axis_dataframe(df, f, 1)
        0    2
        1    2
        2    2
        3    2
        dtype: int64
        >>> apply_function_on_axis_dataframe(df, f, 0)
        a    9
        b    9
        c    9
        dtype: int64
    """
    return df.apply(func, axis)