Python supersmoother 0.4 zero denominator error

21 Views Asked by At

I have some time-serial measurement data and I want to fit a smooth curve out of it. I tried to do it with supersmoother package. Below is my code:

from supersmoother import SuperSmoother
import numpy as np

cx = np.array([0,1,2,3,4])
cy = np.array([.7,.4,.6,.2,.8])

ssmoother = SuperSmoother(alpha=2)
ssmoother.fit(cx,cy)

ValueError: Zero denominator in linear smooth. This usually indicates that the input contains duplicate points.

However if I try

ssmoother.fit(cy, cx)

Then it works. I don't understand why it fails with fit(cx,cy) but not with fit(cy,cx)

I tried to debug it but it seems the failure message comes from the design. But I can't find any explanation on how to avoid this error in the future.

0

There are 0 best solutions below