我有一个具有以下结构的数据框
Debtor ID | AccountRating | AccountRatingDate | AmountOutstanding |AmountPastDue
John Snow Closed 2017-03-01 0 0
John Snow Delayed 2017-04-22 2000 500
John Snow Closed 2017-05-23 0 0
John Snow Delayed 2017-07-15 6000 300
Sarah Parker Closed 2017-02-01 0 0
Edward Hall Closed 2017-05-01 0 0
Douglas Core Delayed 2017-01-01 1000 200
Douglas Core Delayed 2017-06-01 1000 400
Run Code Online (Sandbox Code Playgroud)
我想要实现的是
Debtor ID | Incidents of delay | TheMostRecentOutstanding | TheMostRecentPastDue
John Snow 2 6000 300
Sarah Parker 0 0 0
Edward …Run Code Online (Sandbox Code Playgroud) 我有三个具有以下结构的表
CUSTOMER
OwnerID | ProfileID (PK)| Name | Surname | Address
Owner1 Profile1 John Brown some address
Owner1 Profile2 John Brown some address
Owner1 Profile3 John Brown some address
Owner2 Profile4 Charles Snow some address
Owner2 Profile5 Charles Snow some address
Owner2 Profile6 Charles Snow some address
Owner3 Profile7 Edward Glork some address
Owner3 Profile8 Edward Glork some address
LOANS
LoanID (PK)| ProfileID | Amount | Duration
Loan1 Profile1 5000 31
Loan2 Profile2 1000 31
Loan3 Profile4 4000 31
Loan4 …Run Code Online (Sandbox Code Playgroud)