I have dataframe
member_id,event_type,event_path,event_time,event_date,event_duration
20077,2016-11-20,"2016-11-20 09:17:07",url,e.mail.ru/message/14794236680000000730/,0
20077,2016-11-20,"2016-11-20 09:17:07",url,e.mail.ru/message/14794236680000000730/,2
20077,2016-11-20,"2016-11-20 09:17:09",url,avito.ru/profile/messenger/channel/u2i-558928587-101700461?utm_source=avito_mail&utm_medium=email&utm_campaign=messenger_single&utm_content=test,1
20077,2016-11-20,"2016-11-20 09:17:37",url,avito.ru/auto/messenger/channel/u2i-558928587-101700461?utm_source=avito_mail&utm_medium=email&utm_campaign=messenger_single&utm_content=test,135
20077,2016-11-20,"2016-11-20 09:19:53",url,e.mail.ru/message/14794236680000000730/,0
20077,2016-11-20,"2016-11-20 09:19:53",url,e.mail.ru/message/14794236680000000730/,37
and have another df2
domain category subcategory unique id count_sec Main category Subcategory
avito.ru/auto Автомобили Авто 1600 83112396 Auto Avito
youtube.com Видеопортал Видеохостинг 1317 42710996 Video Youtube
ok.ru Развлечения Социальные сети 694 13394605 Social network OK
kinogo.club Развлечения Кино 497 8438800 Video Illegal
e.mail.ru Почтовый сервис None 1124 8428984 Mail.ru Email
vk.com/audio Видеопортал Видеохостинг 1020 7409440 Music VK
Usually I use:
df['category'] = df.event_date.map(df2.set_index('domain')['Main category']
But it's compare data and if it's equal, it takes values and create it in new column. But how can I do the same, but use if substring in string?