appending data rows from multiple dataframes to a time dataframe

Viewed 31

I am trying to put data from multiple data sources in a dataframe that contains 5 minutes time slots (over the timeframe of an hour).

for example:

dataframe1:

A time
c 11:07:05
d 11:05:00

dataframe2:

B time
e 11:10:00
f 11:03:00

time dataframe:

timeslot
11:05:00
11:10:00

Desired output dataframe (unsure if this is best):

timeslot time_A time_B A B
11:05:00 11:05:00 c
11:10:00 11:07:05 d
11:05:00 11:03:00 e
11:10:00 11:10:00 f

The reason for doing all of this is to make sure that if, per timeslot, A and B were provided in those timeslots. I've tried merging A and B and then sorting based on timeslots but I have been told that it is the wrong approach. thankful for any advice. (Edit: sometimes it may occur that there are multiple rows from the first dataframe that goes in one of the timeslots, or from the second dataframe. this might be important later on to count how much data is coming in from the data sources per timeslot)

0 Answers
Related