1

I have a dataframe with two columns in which one is 'date_time' value and other (position) is a float. I have to merge two dataframes such that difference between the date_time values of the two frames is less than 30 min and position difference is less than 100 (metres). How do I do this?. I used merge_asof and used left_by and right_by.But its giving the error

MergeError: No common columns to perform merge on. Merge options: left_on=None, right_on=None, left_index=False, right_index=False 

I have a common column 'ID' though it doesnt have same values in both frames. How can I accomplish this.From Documentation my understanding is that left_by and right_by is used when more than two columns is used.I have also tolerance to get the difference between them ~ 30 min ,but I also need the position difference to be ~ 100m Can I give tolerance as a list like ('tolerance' = pd.Timedelta('30min'),100) I dont know. Or if not possible is there some other way?

Fasty
  • 784
  • 1
  • 11
  • 34

0 Answers0