I have the following data frame: I am trying to apply a spline interpolation on each row to get the values for 2017 and 2018 using the following code: However, I get the following error: ValueError: Index column must be numeric or datetime type when using spline method other than linear. Try setting a numeric or datetime index column before
Tag: interpolation
Subplots won’t display together + griddata() returning “nan” values
I have a 9×9 matrix in which I know 8 values, at the positions contained in array points, with corresponding values in array values. I want to interpolate the unknown values and paste the result on a 200×200 image. I’m a beginner at python and I’m struggling with the following: My subplots won’t display together. Subplot(121) and subplot(122) should create
Interpolating measured sine wave using python
I have 2 sampled sine waves obtained as a measurement from a DSO. The sampling rate of the DSO is 160 GSa/s and my signal is 60 GHz. I need to find the phase difference between the two sine waves. …
Pulling x-values of spline integer y-values?
I have the given sample data and interpolated spline: import matplotlib.pyplot as plt import numpy as np from scipy import interpolate x = [0.1, 1.5, 2.3, 5.5, 6.7, 7] y = [5, 4, 5, 2, 2, 3] s = …
Resample df to smaller time steps and average the counts
I have a dataframe containing counts over time periods (rainfall in periods of 3 hours), something like this: time_stamp, rain_fall_in_mm 2019-01-01 00:03:00, 0.0 2019-01-01 00:06:00, 3.9 …
Connect the dots in pandas
TLDR I want to do the equivilent of an Excel VLOOKUP in pandas. The unique thing about this question is that the exact values I am looking up do not exist. I want to do a linear interpolation to look …
Interpolation of points along the spline using scipy.interpolate.splrep
I’m working on the task of interpolating the points along the lanes in the images. A sample image with annotated points(image not from the actual dataset and spacing between the point is also not …
resample/interpolate time series with datetimeindex
I have two dataframes each containing one or more time series from the same time frame but sampled at different timestamps. I’d like to merge them into a single one resampled and interpolated with the index of the first. Here’s a sample of the first dataframe: And the second one: In this case the second […]