Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 17100

Indicator if a rejected_time within a group is within 5 minutes after a creation_timestamp

$
0
0

I'm trying to set up an indicator for when a new application causes the rejection of an old application.

If any rejected_time within a personal_id occurs within 5 minutes after a creation_timestamp, it has been rejected because of the new application. Based on this, I should create the column "new_application_causes_rejection" as presented in the example.

There are hundreds of thousands of personal IDs, most with multiple application IDs, and the number of rows within the application IDs varies.

personal_idapplication_idcreation_timestampapproved_amountrejected_timenew_application_causes_rejection
5a694f2023-01-24 13:01:07.9395348000.02023-01-24 13:13:15.4990000
5a694f2023-01-24 13:01:07.9395348000.02023-01-24 14:38:02.3590001
5a694f2023-01-24 13:01:07.9395348000.02023-01-24 14:37:18.6160001
5a694f2023-01-24 13:01:07.939534NaN2023-01-24 13:03:59.6260000
5a43fa2023-01-24 14:36:08.287521NaN2023-01-24 14:37:22.0960000
5a43fa2023-01-24 14:36:08.28752113000.02023-01-24 14:39:31.7500001
5a43fa2023-01-24 14:36:08.28752113000.02023-02-02 08:42:26.9801061
5a43fa2023-01-24 14:36:08.287521NaN2023-01-24 14:37:22.9482140
5aa4b62023-01-24 14:38:42.6259695000.02023-02-02 08:42:26.9801060
5aa4b72023-01-24 14:38:42.625969NaN2023-01-24 14:38:46.9220000
5aa4b82023-01-24 14:38:42.6259698000.02023-02-02 08:42:26.9801060

Viewing all articles
Browse latest Browse all 17100

Latest Images

Trending Articles



Latest Images