Lets say I had the following dataframe
import pandas as pd
data = [['Mallika', 23, 'Student'], ['Yash', 25, 'Tutor'], ['Abc', 14, 'Clerk']]
data_frame = pd.DataFrame(data, columns=['Student.first.name.word', 'Student.Current.Age.word', 'Student.Current.Profession.word'])
Student.first.name.word Student.Current.Age.word Student.Current.Profession.word
0 Mallika 23 Student
1 Yash 25 Tutor
2 Abc 14 Clerk
How would I sub out the common column header words "Student" and "word"
so that you would get the following dataframe:
first.name Current.Age Current.Profession
0 Mallika 23 Student
1 Yash 25 Tutor
2 Abc 14 Clerk