I am working on a project in which I am required to use Interpolation to create equally spaced position values as the position samples are not equally spaced due to varying train speed.
So, the total length of my data is 93636218. After interpolation, the length has reduced to 5506829. This is creating problem for me as I am unable to insert the interpolated values into my original data. I have used the following code for interpolation:
x = np.array(data['Position [m]'])
y = np.array(sensor data)
spacing = 0.01
position_equally_spaced_x = np.arange(x[0], x[-1], spacing)
sensor data_new = interp1d(x, y)(position_equally_spaced_x)