def exponential_moving_average(df, base, target, period):
    """
    Function to compute Exponential Moving Average (EMA)
    This is a lagging indicator

    df - the data frame
    base - on which the indicator has to be calculated eg Close
    target - column name to store output
    period - period of the ema
    """
    df[target] = df[base].ewm(ignore_na=False, min_periods=period, com=period, adjust=True).mean()
    return df