def calc_diff(data, column1='open', column2='close'):
    """
    Calculate the difference between a column and the previous value
    of another column of a dataframe.

    Parameters:
        - data: The base DataFrame().
        - column1: The first column.
        - column2: The second column.

    Returns:
        A Series() object.
    """
    return data[column1] - data[column2].shift()