Mat
Mat

Reputation: 41

How to merge to dataframes based on Interval condition

I have two data frames of the format

enter image description here

enter image description here

I want to concatenate the two such that I have a resultant table of the format enter image description here

Thanks in advance!

Upvotes: 0

Views: 73

Answers (1)

Puneeth R
Puneeth R

Reputation: 95

Use pandas outer merge. For example if your first dataframe is df1 and second is df2 then,

result_df = df1.merge(df2, how="outer", left_on="Time 15 Min",right_on="Time Event")

See documentation for more info.

Upvotes: 2

Related Questions