Hi All,
I am a newbie in python and got stuck. Actually i want to select the data after comparing 2 data frames i.e. want to select all the records for matched Consumer_No from df2 for all the records whose date is lesser or equal to df2['Date']
I am a newbie in python and got stuck. Actually i want to select the data after comparing 2 data frames i.e. want to select all the records for matched Consumer_No from df2 for all the records whose date is lesser or equal to df2['Date']
df1 = {Consumer_No :[1011,1012,1013,1014,1011,1012,1013,1014,1011,1012,1013,1014,1011,1012,1013,1014], Date:['31/01/2019','31/01/2019','31/01/2019','31/01/2019','28/02/2019','28/02/2019','28/02/2019','28/02/2019','31/03/2019','31/03/2019','31/03/2019','31/03/2019','30/04/2019','30/04/2019','30/04/2019','30/04/2019'] } df2 = {Consumer_No : [1013,1011],Date:['24/03/2019','29/04/2019']} if df1['Consumer_No']== df2['Consumer_No']: if df1['Date'] >= df2['Date']: matched = pd.merged(df1,df2, on='Consumer_No')Please help me out in the same.