Let's take this small dataframe :
df = pd.DataFrame(dict(Name=['abc','abcd','bc']))
Name
0 abc
1 abcd
2 bc
I would like to create a new dataframe :
- Having its index and column names equal to the values of column Name
- Whose values are equal to true or false if the index belongs to the column name
Expected output :
abc abcd bc
abc True True False
abcd False True False
bc True True True
How please could I do ?