for i in range(len(associationrules)): associationrules['antecedents'][i] = list(associationrules['antecedents'][i]) associationrules['consequents'][i] = list(associationrules['consequents'][i])