I need to combine two datasets, into a single dataset.
I have two generated data frames - pandas, one with data samples every ~second, another with data sampled every ~120 seconds.
How can i merge these two, governed by the interval of the app. 120 sec generating task.
I have currently pulled every 120'th sampleset out of the fast generated 1 sec. data set. These are not accurate, 1 second and contain a bit of jitter.
Time Torque [Nm] Speed [1/s]
54240 2017-04-05 21:21:21 938.00 3000.0
54252 2017-04-05 21:23:23 936.25 3000.0
54264 2017-04-05 21:25:24 948.50 3000.0
54276 2017-04-05 21:27:26 948.50 3000.0
54288 2017-04-05 21:29:28 936.25 3000.0
54300 2017-04-05 21:31:29 952.00 3000.0
54312 2017-04-05 21:33:31 945.00 3000.0
54324 2017-04-05 21:35:33 927.50 3000.0
And likewise i have the data set with 120 sec intevals
Time FFT ISO FFTe: FO
0 2017-04-05 21:26:08 20.5754 16.377570
1 2017-04-05 21:28:08 106.1549 32.836566
2 2017-04-05 21:30:07 16.2735 19.308864
3 2017-04-05 21:32:08 24.2232 42.766070
4 2017-04-05 21:34:08 35.5723 64.152879
5 2017-04-05 21:36:08 3.7364 29.323316
6 2017-04-05 21:38:08 21.8207 17.796711
7 2017-04-05 21:40:08 9.9334 49.642802
The timestamps are not identical, and may contain a bit of jitter.
I would like to combine the data columns, so the data (Torque [Nm], Speed [1/s], FFT ISO, FFTe: FO) occurring within the same 120 second interval are combined.
Perhaps i should define a 120 second "reference interval", and fit the data into these equally sized slots.
A assume it can be done using pd.concat
or pd.append
but i have not quite figured how
Any help is appreciated