I spent a day trying to solve my problem...
I have a DataFrame that I import from CSV file. Here an example:
df=pd.DataFrame(['{"choices": ["rougeur", "hematome","oedeme","ecoul","necrose"]}','ecoul','necrose','','oedeme'])
I have my list of my possible labels:
label_sl=['rougeur', 'hematome', 'oedeme','ecoul','extra','necrose']
I would like to create a new dataframe that returns:
rougeur hematome oedeme ecoul extra necrose
1 1 1 1 0 1
1 0 0 0 0 0
0 0 0 0 0 1
0 0 0 0 0 0
0 0 1 0 0 0
I don't find the solution... If you have an idea...
Thanks,
AL
'{"choices": ["rougeur", "hematome","oedeme","ecoul","necrose"]}'? Why is it in a dictionary form? Could there be more key:value pairs?