create dataframe pandas with specific column as index code example Example: make a specific column a df index df.set_index('column_name')