how to give column and index names in pandas code example Example: rename dataframe index column pandas df.index.names = ['new_name']