title: Fitting spline to data with duplicate x using scipy (Python)
body: <p>I am trying to fit spline on my data having 5700 data samples (with duplicate x values ie. x: horizontal axis) using 'interp1d' function from package 'scipy' in python. I tried with lower order spline (k=1) and with the quadratic spline(k=2), cubic spline (k=3).
  And I am shocked to witness the weird response of 'spline' on my data.Although spline at 'k=1' made some sense but is ridiculously overfitting it(quadratic and cubic spline performed too bad).In my first trial, I used Polynomial fitting to fit the data and results were encouraging.
  I was expecting spline fitting will give results better than what I got with polynomial fitting.<a href="https://i.stack.imgur.com/EYvrl.png" rel="nofollow noreferrer">This is the result with splines</a>.
  Please suggest me, where am I wrong?</p>