def dequantize(df, method='linear'):
    """
    Tries to undo results of a non-constant sampling rate (ie due to indeterministic buffering).

    :param str method: see :method:`pd.DataFrame.interpolate()` that is used to fill-in column-values that are held constant

    .. Note::
        The results wil never have a flat section, so checking for some value (ie 0)
        must always apply for some margin (ie (-e-4, e-4).
    """
    df1 = df.where(df.diff() != 0)
    df1.iloc[[0, -1]] = df.iloc[[0, -1]]
    df1.interpolate(method=method, inplace=True)
    return df1
