Probability, Data Science, Python, Python Programming, Statistics.
(i.e., “True True” becomes “TT”). We’ll call this column item2. import pandas as pd import matplotlib.pyplot as plt df = pd.DataFrame.from_dict(counts, orient='index') df = df.rename(columns={0: 'item_counts'}) df['probability'] = df['item_counts']/1000 df['item2'] = ['TT', 'FF', 'FT', 'TF'] Here