Below is the data I am working on:
df_raw = pd.DataFrame({'Summary':['|ro-rd4_ae20|Issue-backfgound', '|20:36|site1_shutdown'], 'User':[r'UPC\User',r'UPC\Ankita'], 'Name':['Generic User', 'CSD']})
Using a regular expression, I want to check pattern for 'Name' =CSD and 'Name' ='Generic User' separately which will create new column giving true / false value if matches pattern in re.
If df_raw.Name ='CSD'
then apply reg. exp (df_raw['Summary'].str.findall(r'(([?:[01]?\d|2[0-9]):[0-9]\d|[a-z0-9A-Z-._]+)', expand=False))
and df_raw.Name = 'Generic User'
then apply reg exp (df_raw['Summary'].str.findall(r'(([?:[01]?\d|2[0-9]):[0-9]\d|[a-z0-9A-Z-._]+)', expand=False))
I have tried adding re in variable and apply but that is not helping/not giving output
pls help with this