I have a dataset where column names have prefixes (corresponding to panel waves), e.g.
a_age
a_sex
a_jbstat
b_age
b_sex
b_jbstat
I would like to convert the prefixes into suffixes, so that it becomes:
age_a
sex_a
jbstat_a
age_b
sex_b
jbstat_b
I'd be grateful for suggestions on efficient ways of doing this.