I have a dataframe like this
| A | B | C | |-------|---|---| | ['1'] | 1 | 1 | |['1,2']| 2 | | | ['2'] | 3 | 0 | |['1,3']| 2 | | if the value of B is equal to A within the quotes then C is 1. if not present in A it will be 0. Expected output is:
| A | B | C | |-------|---|---| | ['1'] | 1 | 1 | |['1,2']| 2 | 1 | | ['2'] | 3 | 0 | |['1,3']| 2 | 0 | Like this I want to get the dataframe for multiple rows. How do I write in python to get this kind of data frame?
print (df.A.head().tolist())?