This is my first dataframe.
How can i achieve only concat the columns name with _flag only and concat its value if True to another column at each row. The expected outcome is the dataframe below
import pandas as pd
import numpy as np
a= dict()
a['name']=['test','test1']
a['a_flag']=[True,True]
a['b_flag']=[True,False]
a['c_flag']=[True,False]
a['d_flag']=[True,True]
df = pd.DataFrame(a)
col_flag = df.filter(like='_flag')