rules_df.sort_values(by='Confidence',ascending=False,inplace = True) n = 1 for i in range(len(rules_df)): if (rules_df.iloc[i,3]*100) < 80: break print(f'{n}. {colored(np.round(rules_df.iloc[i,3]*100,1),"grey","on_cyan")}{colored("%","grey","on_cyan")} of the respondents who use {colored(rules_df.iloc[i,0],"grey","on_cyan")} also use {colored(rules_df.iloc[i,1],"grey","on_cyan")}\n') n += 1