Apr-03-2019, 11:28 AM
Hi there,
I'm still facing this same problem. Subtotals needs to matched with details table and also there can be mismatching items in detail table.
I'm still facing this same problem. Subtotals needs to matched with details table and also there can be mismatching items in detail table.
import pandas as pd import datetime as dt subtotal = pd.DataFrame(data = {'Date':['21/09/2018 17:45:27','21/09/2018 18:59:24','21/09/2018 20:42:03'], 'Amount':[2000,3000,6000], 'Ref':[1,2,3]},columns=['Date', 'Amount', 'Ref']) detail = pd.DataFrame(data = {'Date':['21/09/2018 17:37:05','21/09/2018 17:56:22','21/09/2018 17:56:53','21/09/2018 18:54:56','21/09/2018 19:12:56','21/09/2018 19:30:30 ','21/09/2018 21:35:59','21/09/2018 21:36:20','21/09/2018 21:43:32 '], 'Amount':[1000,500,500,1000,3000,12000,1000,2000,3000]}, columns=['Date', 'Amount'])My expected result is a table like this
Output:Table2
Ref DateTime Value Result
1 09/21/2018 17:37 1,000.00 Index1
2 09/21/2018 17:56 500.00 Index1
3 09/21/2018 17:56 500.00 Index1
4 09/21/2018 18:54 1,000.00 Index2
5 09/21/2018 19:12 2,000.00 Index2
6 09/21/2018 19:30 12,000.00 No Match
7 09/21/2018 21:35 1,000.00 Index3
8 09/21/2018 21:36 2,000.00 Index3
9 09/21/2018 21:43 3,000.00 Index3