1df = DataFrame({'var_1':['a','b','c'], 'var_2':[1, 2, 3], 'var_3':['apple', 'banana', 'pear']})
2cols = ['var_1', 'var_2'] # Set columns to combine
3df['combined'] = df[cols].apply(lambda row: ', '.join(row.values.astype(str)), axis=1)
4
5# Define which column is index
6df_i = df.set_index('combined')
7
8# Set the index to None
9df_i.index.names = [None]