allowed_val = {0, 1, True, False}
unique_val = np.unique(df.values.ravel())
for val in unique_val:
if val not in allowed_val:
s = ("The allowed values for a DataFrame"
" are True, False, 0, 1. Found value %s" % (val))
After Change
http://rasbt.github.io/mlxtend/user_guide/frequent_patterns/apriori/
idxs = np.where((df.values != 1) & (df.values != 0))
if len(idxs[0]) > 0:
val = df.values[idxs[0][0], idxs[1][0]]
s = ("The allowed values for a DataFrame"
" are True, False, 0, 1. Found value %s" % (val))
raise ValueError(s)