Good Morning: I just started learning pandas and i have been searching for a comparison option but I think I don't know what terms to look for
DF1
Day|Time|Dept|Val
01/01/2020|8:42|PWD|10
01/02/2020|8:42|PWD|60
01/03/2020|8:42|PWD|140
01/04/2020|8:42|PWD|200
DF2 [To compare against]
Day Time Dept Val
01/01/2020 8:42 PWD 10
01/01/2020 8:46 PWD 12
01/01/2020 9:21 PWD 21
01/01/2020 10:15 PWD 18
01/01/2020 11:30 PWD 26
01/01/2020 12:25 PWD 15
01/02/2020 8:42 PWD 60
01/02/2020 8:46 PWD 55
01/02/2020 9:21 PWD 19
01/02/2020 10:15 PWD 102
01/02/2020 11:30 PWD 111
01/02/2020 12:25 PWD 120
01/03/2020 8:42 PWD 140
01/03/2020 8:46 PWD 90
01/03/2020 9:21 PWD 50
01/03/2020 10:15 PWD 220
01/03/2020 11:30 PWD 290
01/03/2020 12:25 PWD 210
01/04/2020 8:42 PWD 200
01/04/2020 8:46 PWD 90
01/04/2020 9:21 PWD 50
01/04/2020 10:15 PWD 220
01/04/2020 11:30 PWD 250
01/04/2020 12:25 PWD 399
What I would like your help with is to find the first instance per day on DF2 based on DF1 Value that is at least double
So for Jan 1, since DF1 value is 10, I have to find the first instance of value greater than or equal to 20 for Just Jan 1 in DF2 and so on.
So output should be either a new dataframe or just modify DF1
Day Time Dept Val Found Found_time
0 01/01/2020 8:42 PWD 10 True 9:21
1 01/02/2020 8:42 PWD 60 True 10:15
2 01/03/2020 8:42 PWD 140 True 11:30
3 01/04/2020 8:42 PWD 200 False NULL
To get more background on what I have done so far, my original question which directed me towards Pandas Row sorting and selection logic in Python on Sqlite db
Thanks all for your help. It's been twenty four years since I have coded and I am amazed at how much languages have changed from fortran and cobol.