def dup_diff(f, m, K):
    if m <= 0:
        return f

    n = dup_degree(f)

    if n < m:
        return []

    deriv = []

    if m == 1:
        for coeff in f[:-m]:
            deriv.append(K(n)*coeff)
            n -= 1
    else:
        for coeff in f[:-m]:
            k = n

            for i in range(n - 1, n - m, -1):
                k *= i

            deriv.append(K(k)*coeff)
            n -= 1

    return dup_strip(deriv)
Make the plot.
dataset/ETHPy150Open sympy/sympy/sympy/polys/densetools.py/dup_diff--crossover with--dataset/ETHPy150Open mwaskom/seaborn/seaborn/categorical.py/_BoxPlotter.plot