def smooth_array(input, smooth):
    """Smooth array using exponential moving average

    Args:
        input: input data
        smooth: smooth factor, 0<=smooth<1

    Returns:
        Smoothed array
    """
    return input.ewm(alpha=(1 - smooth)).mean()