set index to column values pandas code example Example: set index in datarame df = df.set_index('col')