Reputation: 581
I have accelerometer data with variable sampling rate. I am trying to increase it a constant sampling rate 50hz through interpolation.The problem with the timestamps is, it doesn't have milliseconds.
How do i do it without losing the data i already have?
Upvotes: 1
Views: 1232
Reputation: 568
You can first set the index as your datetime column using df.set_index('timestamp')
and use df.resample()
. The directive you want to pass into the resample
function is L
for milliseconds, but you can read more here. The resample
function also lets you choose a number of interpolation modes.
Upvotes: 1