This can be achieved with the help itertoolsand understanding of the list:
from itertools import combinations, chain
gen = ([(g,)+i for i in list(combinations(df.loc[df['group'] == g, 'value'], 2))] \
for g in df['group'].unique())
df_out = pd.DataFrame(list(chain.from_iterable(gen)), columns=['group', 0, 1])
Result
group 0 1
0 A a b
1 A a c
2 A a d
3 A b c
4 A b d
5 A c d
6 C d e
7 C d a
8 C e a
source
share