You can try this:
import pandas as pd
df = pd.DataFrame([['Action', 'Casual', 'NaN'], ['Action', 'NaN', 'Indie'], ['Action', 'NaN', 'NaN']], columns=['Action', 'Casual', 'Indie'])
df = df.apply(lambda x: x == x.name)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.