After computing percentiles within group, the header names is in tuple format like [('A', 0.5), ('A',0.9)...('Z',0.9)].
The desired output should be:
['P50 A', 'P90 A', ...'P90 Z']
Basically, I want to multiply the decimal by 100 to get percentage and move it up front, append a letter 'P' in every field.
I feel like I should use map or join like suggested here: How to change the columns name from a tuple to string?
But not sure how to deal with the details.
df.columns=df.columns.map('{0[0]} {0[1]}'.format)