merging df in pandas based on "contains" values
I have 2 dfs
df_1
Nº.do Incidente Status Description Per_Extracao
0 IN6948271 ENCERRADO GR26 D.I.T.I. >>> ABEND NO JOB PP_SASG_GD9822... DE : 2022/01/05 ATÉ : 2022/12/08
1 IN6948304 ENCERRADO GR26 D.I.T.I. >>> ABEND NO JOB PP_AACE_R4539 ... DE : 2022/01/05 ATÉ : 2022/12/08
2 IN6948307 ENCERRADO GR26 D.I.T.I. >>> ABEND NO JOB PP_ADAT_SPRK_EX... DE : 2022/01/05 ATÉ : 2022/12/08
3 IN6948309 ENCERRADO GR26 D.I.T.I. >>> ABEND NO JOB PP_ADAT_SPRK_EX... DE : 2022/01/05 ATÉ : 2022/12/08
4 IN6948310 ENCERRADO GR26 D.I.T.I. >>> ABEND NO JOB PP_ADAT_SPRK_EX... DE : 2022/01/05 ATÉ : 2022/12/08
5 IN6948311 ENCERRADO GR26 D.I.T.I. >>> ABEND NO JOB PP_ADAT_SPRK_EX... DE : 2022/01/05 ATÉ : 2022/12/08
df_2
JOB_NAME JOB_STREAM_NAME
0 PP_AACD_NR_D8706_TIHIBRIDA_PROC_EXCUC_D P26_AACD_FAC_TOD
1 PP_SASG_GD9822 P26_AACE_U08
2 PP_AACE_R4539 P26_AACE_U09
3 PP_AACE_R4539_CONS_JUNC P26_AACE_U08
4 PP_AACE_R4539_FMRC_TD_01 P26_AACE_U08
5 PP_AACE_R4539_FMRC_TD_02 P26_AACE_U08
I'm trying to merge then based on the value of JOB_NAME in df_2
the output should be something like this
merged_df
Nº.do Incidente Status Description Per_Extracao JOB_NAME JOB_STREAM_NAME
0 IN6948271 ENCERRADO GR26 D.I.T.I. >>> ABEND NO JOB PP_SASG_GD9822... DE : 2022/01/05 ATÉ : 2022/12/08 PP_SASG_GD9822 P26_AACE_U08
1 IN6948304 ENCERRADO GR26 D.I.T.I. >>> ABEND NO JOB PP_AACE_R4539 ... DE : 2022/01/05 ATÉ : 2022/12/08 PP_AACE_R4539 P26_AACE_U09
its not a regular join, its a contains contains condition("JOB_NAME" value in df_2 founded in "Description" column of df_1).
could you guys help me please?
Comments
Post a Comment