I have the following dataframe:
And I would like to convert the columns "antecedents" and "consequents" to string, removing the "frozenset({ ... })" format and thus have, for all the rows:
"VENTOLIN S.INAL200D 100MCG", instead of frozenset({ "VENTOLIN S.INAL200D 100MCG" }).
I managed to achieve the result with:
prod = []
for i in df["antecedents"]:
prod.append(str(i))
new_set = {x.replace('frozenset', ''
).replace('})', ''
).replace('({', ''
).replace("'", "") for x in prod}
Is there a more pythonic solution?
