def lagrange(x_data, y_data):
    """
    Compute the interpolant polynomial corresponding to the
    points given in (x_data, y_data)

    Parameters
    ----------
    x_data : list
        List with x coordinates for the interpolation.
    y_data : list
        List with y coordinates for the interpolation.

    Returns
    -------
    fun_poly : Python function
        Interpolant polynomial as evaluable function.

    """
    def fun_poly(x):
        num = len(x_data)
        acu = 0
        for i in range(num):
            prod = 1
            for j in range(num):
                if i == j:
                    continue
                prod = prod * (x - x_data[j])/(x_data[i] - x_data[j])
            acu = acu + prod * y_data[i]
        return acu
    return fun_poly