0

Let's say I have the data, where x values = dates from 1st January and the next 30 days, and y values = for every date, which % of users from my website were active on it

Then I want to build plt.plot on X and Y and make it smooth.

When I interpolate the data using any scipy functions I found, some y values are always negative or > 1, which doesn't make sence. How to avoid it?

Timur
  • 77
  • 6
  • 2
    Without actual code is hard to know why this happens (it is better if you can provide a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example)), but have in mind that interpolation artifacts may always happen (occasionally reaching values higher or lower than those of the original data). – Lith Mar 04 '21 at 18:39
  • `from scipy.interpolate import pchip` and `yi = pchip(x, y)(xi)` – JohanC Mar 04 '21 at 20:09

0 Answers0