I have datafarme as below.
ID COUNTRY GENDER AGE V1 V2 V3 V4 V5
1 1 1 53 APPLE apple bosck APPLE123 xApple111t
2 2 2 51 BEKO beko SIMSUNG SamsungO123 ttBeko111t
3 3 1 24 SAMSUNG bosch SEMSUNG BOSC1123 uuSAMSUNG111t
I want to replace to np.nan if there are same value in list or contain specific value. I tried below but occurred error.
remove_list = ['APPLE', 'BEKO']
remove_contain_list = ['SUNG', 'bosc']
df.iloc[:,4:].str.replace(remove_list, np.nan, case=False) # exact match & case sensitive
df.iloc[:,4:].str.contains(remove_contain_list, np.nan, case=False) # contain & case sensitive
How can I solve these problems?