df = pd.DataFrame(np.random.randint(0,6,size=(1200000, 3)),
columns=list('ABC'))
df['sum'] = df[['A','B','C']].sum(axis=1)
df = df[df['sum']==5]
df = df.sample(n=100000)
I want to create a dataframe with three different columns with random numbers between 0 and 5 such that sum across column is 5.