I know I can rename single pandas.DataFrame columns with:
drugInfo.rename(columns = {'col_1': 'col_1_new_name'}, inplace = True)
But I'd like to rename a column based on its index (without knowing its name) - although I know dictionaries don't have it). I would like to rename column number 1 like this:
drugInfo.rename(columns = {1: 'col_1_new_name'}, inplace = True)
But in the DataFrame.columns dict there is no '1' entry, so no renaming is done. How could I achieve this?