I would like to replace numeric column names in a DataFrame with their corresponding word names but still be able to sort the column names in order such that 'two' comes before 'eight'.
When learning Python, I came across a concept whereby we could say 'foo' means 3 and 'bar' means 8 such that later on in the program, 'foo' * 'bar' will be interpreted as 3*8 .
The solutions that I have come across so far (e.g this and this) involved explicitly converting the strings to integers before carrying out operations but I would like to assign numeric values to those strings such that python inherently knows what they represent however, I am no longer able to remember the name of the concept so my google search is not going smoothly. How can I do this?