Thank you in advance for taking the time to help me
I have 2 dataframes: 1 - dataframe with notifications that i want to send to users
notifications_to_send = pd.DataFrame({'user_id': ['201', '207', '223', '212', '112', '311'],
'id_notification': ['1', '1', '1', '1', '1', '1'],
'email':['[email protected]','[email protected]','[email protected]','[email protected]','[email protected]','[email protected]']
})
user_id id_notification email
0 201 1 [email protected]
1 207 1 [email protected]
2 223 1 [email protected]
3 212 1 [email protected]
4 112 1 [email protected]
5 311 1 [email protected]
2 - dataframe with info about users who set option to don't limit the quantity of sending notification to them
unlimited_notifications = pd.DataFrame({'user_id': ['201', '212'],
'id_notification': ['1', '2']})
user_id id_notification
0 201 1
1 212 2
so I want to add column 'send_push' to first dataframe, that will determine that push will be sent if user set unlimited option I thought about merge 2 dataframes on user_id and id_notification
notifications_to_send.merge(unlimited_notifications, on=['user_id','id_notification'], how='left')
, and for row which fits with this condition 'send_push' will be set on True, if condition don't execute then set it on Null, so it would look like this:
user_id id_notification email send_push
0 201 1 [email protected] True
1 207 1 [email protected] null
2 223 1 [email protected] null
3 212 1 [email protected] null
4 112 1 [email protected] null
5 311 1 [email protected] null
so the questions is how to add new column while merge or maybe there is any other way to make it? Compare two dataframes?

unlimited_notificationsdataframe contains only the users that you want thesend_pushcolumn to beTrue? Does theid_notificationcolumn on that dataframe have any meaning?