I need to change below dataframe:
I want the output in below form:
I tried to use itertools.combinations_with_replacement to get all combination
from itertools import combinations_with_replacement comb = list(combinations_with_replacement(pairwise_similarity_df.index,2))
matrix is 10000*10000 so i expected 100000000 rows but got only 50005000.
how can i convert this to required format?