-1
lista = array(['NF', 'BT', 'C', 'N', 'I', 'IP',
'Aa', 'Sa', 'Gl', 'Et', 'To', 'Hr',
'Cr', 'Ro', 'X', 'Oa', 'Ml', 'Me'], dtype=object)
"DATAFRAME"
x_1 x_2
0 NF 0
1 A 0
2 B 0
3 KK 0
4 Gl 0
5 Oa 0
The desired exit would be this below :
x_1 x_2
0 NF NF
1 A 0
2 B 0
3 KK 0
4 Gl Gl
5 Oa Oa
If the column value is equal to any given array it returns the new column with this value otherwise returns 0
I’m sorry I didn’t understand how you got from the list to the dataframe? Or compare list with a column of a dataframe whose code is not present in the question?
– Augusto Vasques