linear-interpolation

Python regularise irregular time series with linear interpolation

[亡魂溺海] 提交于 2019-11-26 15:54:56
问题 I have a time series in pandas that looks like this: Values 1992-08-27 07:46:48 28.0 1992-08-27 08:00:48 28.2 1992-08-27 08:33:48 28.4 1992-08-27 08:43:48 28.8 1992-08-27 08:48:48 29.0 1992-08-27 08:51:48 29.2 1992-08-27 08:53:48 29.6 1992-08-27 08:56:48 29.8 1992-08-27 09:03:48 30.0 I would like to resample it to a regular time series with 15 min times steps where the values are linearly interpolated. Basically I would like to get: Values 1992-08-27 08:00:00 28.2 1992-08-27 08:15:00 28.3

How to implement linear interpolation?

给你一囗甜甜゛ 提交于 2019-11-26 12:26:27
问题 Say I am given data as follows: x = [1, 2.5, 3.4, 5.8, 6] y = [2, 4, 5.8, 4.3, 4] I want to design a function that will interpolate linearly between 1 and 2.5 , 2.5 to 3.4 , and so on using Python. I have tried looking through this Python tutorial, but I am still unable to get my head around it. 回答1: As I understand your question, you want to write some function y = interpolate(x_values, y_values, x) , which will give you the y value at some x ? The basic idea then follows these steps: Find

How can i produce multi point linear interpolation? [closed]

核能气质少年 提交于 2019-11-26 00:26:11
问题 I have a linear interpolation methods. This is calculate interpolate value when (x1,y1) (x2,y2) and x0 known. it is calculate y0 value. But i need the do that when multi point known. I am not talking about Bilinear or Trilinear interpolation. 回答1: For multi point interpolation there are 3 options: piecewise linear interpolation choose 2 closest points to your known coordinate if you use parameter then select the points containing parameter range and change the parameter range/scale to