I have a dataframe in a Python script (using pandas) that needs to be sorted by multiple columns, but the case of the values currently messes up the sorting. For example a and A are not equally sorted. First, the upper-case letters are sorted and then the lower-case ones. Is there any easy way to sort them ignoring case. Currently I have something like this:
df = df.sort(['column1', 'column2', 'column3', 'column4', 'column5', 'column6', 'column7'], ascending=[True, True, True, True, True, True, True])
It is important that the case needs to be ignored for all of the columns and the values mustn't change their case in the final sorted dataframe.
For example column 1 could be sorted like this (ignoring case):
Aaa
aaB
aaC
Bbb
bBc
bbD
CCc
ccd
Also, it would be awesome, if the functionality would work with x number of columns (no hard-coding).