I have a dataframe called PATIENTS which looks like this:
  ID   ARR_DATETIME
  1    2013-01-01 03:00:00
  2    2013-05-12 01:00:00
  3    2013-06-23 14:00:00
I have anothe rdataframe called CENSUS and it looks like this:
  DATETIME              COUNT
  2013-01-01 01:00:00    4
  2013-01-01 02:00:00    5
  2013-01-01 03:00:00    9
  ...
  2013-05-12 01:00:00    8
  ...
  2013-06-23 14:00:00   6
What I want is to add another column "COUNT" to my PATIENTS dataframe based on the conditional statement that only the DATETIME matches the ARR_DATETIME.
  ID   ARR_DATETIME           COUNT
  1    2013-01-01 03:00:00    9
  2    2013-05-12 01:00:00    8
  3    2013-06-23 14:00:00    6
I implemented a nested for loop but due to the size of my data, it almost takes forever.
Any suggestions?
 
     
    