Cubic spline interpolation using scipy

I have a dataset that looks like this:

position number_of_tag_at_this_position 3 4 8 6 13 25 23 12 

I want to apply cubic spline interpolation to this dataset to interpolate tag density; for this I run:

 import numpy as np from scipy import interpolate` x = [3,8,13,23]` y = [4,6,25,12]` tck = interpolate.splrep(x,y) # cubic` 

And now I would like to calculate the derivative of the function at each interpolation point. How can i do this? Thank you for your help!

+4
source share

Source: https://habr.com/ru/post/1447753/


All Articles