Flux interpolate package
The interpolate
package provides functions that insert rows for missing
data at regular intervals and estimate values using different interpolation methods.
Import the interpolate
package:
import "interpolate"
Functions
interpolate.linear() function
The interpolate.linear
function inserts rows at regular intervals using linear interpolation to determine values for inserted rows.
import "interpolate"
data
|> interpolate.linear(every: 1d)
Input:
_time | _value |
---|---|
2021-01-01T00:00:00Z | 10.0 |
2021-01-02T00:00:00Z | 20.0 |
2021-01-04T00:00:00Z | 40.0 |
2021-01-05T00:00:00Z | 50.0 |
2021-01-08T00:00:00Z | 80.0 |
2021-01-09T00:00:00Z | 90.0 |
Output:
_time | _value |
---|---|
2021-01-01T00:00:00Z | 10.0 |
2021-01-02T00:00:00Z | 20.0 |
2021-01-04T00:00:00Z | 40.0 |
2021-01-05T00:00:00Z | 50.0 |
2021-01-06T00:00:00Z | 60.0 |
2021-01-07T00:00:00Z | 70.0 |
2021-01-08T00:00:00Z | 80.0 |
2021-01-09T00:00:00Z | 90.0 |
Support and feedback
Thank you for being part of our community! We welcome and encourage your feedback and bug reports for Flux and this documentation. To find support, the following resources are available:
InfluxDB Cloud customers can contact InfluxData Support.