Any operator which works as "merge_asof"

Kumar_Ayush
Kumar_Ayush New Altair Community Member
edited November 2024 in Community Q&A
I want to merge two dataframes on date time columns in both the dataframes but both date time are at different frequencies, how I can merge such data in rapid miner using operator
Tagged:

Answers

  • BalazsBaranyRM
    BalazsBaranyRM New Altair Community Member
    Hi!

    There are two important questions here.
    How do you want to do the join? E. g. Timestamp B between Timestamp A - 1 and Timestamp A? What about multiple entries falling into this range? Multiple matches or just one?
    Are the frequencies very different or similar? 

    There is no easy solution for this and the answer depends on the answers to these questions.

    Some pointers:
    - You could convert the timestamps to a number and round that number to an identical point of time in both data frames (e. g. hours) and join on that.
    - You could convert the timestamps to a number, get the previous value of the timestamp for the join and use the Database Envy extension from the Marketplace and "Expression based join" for something like TsB >= TsA1 && TsB <= TsA.
    - There's "Equalize Time Stamps" for recalculating time series data at exact timestamps.

    So it depends on your use case.

    Regards,
    Balázs
  • btibert3
    btibert3 New Altair Community Member
    I haven't attempted this myself, but one idea might use the python extension, though this would require that you can input two different data sources and hop into pandas code.

    Check out the python extension and related github documentation.