I am trying to learn recommendation systems. I've imported associative rules to my sheet but antecedents and consequents values are formatted as strings I need to convert them to the data type frozenset in python.If a have a string like "frozenset({3048, 3046})"
I need to convert it to (3048,3046)
How can I do that?
Here is the sample code.
import pandas as pdfrozen_df = [{"antecedents" : "frozenset({3048, 3046})","consequents" : "frozenset({10})"}, {"antecedents" : "frozenset({3504, 3507})","consequents" : "frozenset({3048, 85})"}]frozen_df = pd.DataFrame(frozen_df)frozen_df.dtypes