I am looking for a pythonic way to handle this dataframe column and list matching problem:
Here is my dataframe:
![enter image description here](https://i.stack.imgur.com/eGh8X.png)
Now, I have a list of roll_no.:
roll_no_matching = [3,5]
I want to have a matching done between this list and column B a.k.a roll_no. and insert a new column which will have a 0 for no match and 1 for match. e.g. the resulting dataframe will look like:
![enter image description here](https://i.stack.imgur.com/Ryn3Y.png)
I know how to match two dataframes based on any index column and possibly merge some columns from the two dataframes but, I am not sure how to create a new column. Any guidance here is highly appreciated.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…