I would like to know how to flip the "Name, Last, Age" to "Age, First, Last"
Followmycode:
importpandasaspd#Importaabiblioteca"Python Data Analysis"
df = pd.read_excel('Pasta1.xlsx') #Lê o arquivo xlsx
df = df.drop('MiddleInitial', axis = 1) #Remove a coluna "MiddleInitial"
df = df.drop('Gender', axis = 1) #Remove a coluna "Gender"
df.rename(columns = {"Age": "Idade", "GivenName": "Nome", "Surname": "Sobrenome"}, inplace = True) #Altera o nome das colunas
df.head() #lê a linha a cima
dfOrdenado = df.sort_values(by = 'Nome', ascending = True) #Ordena a lista
print(dfOrdenado) #Imprime a Lista