- Change order of columns
- Columns order : 0, 1, 2, ..., n
import pandas as pd
df = pd.read_csv('amazon_fires.csv', encoding = "ISO-8859-1")
new_column_name = { 'ano' : 'year' , 'mes': 'month', 'estado': 'state',
'numero': 'fire_numbers','encontro': 'date'}
df.rename(columns= new_column_name , inplace=True)
df.head()
# new order: date, month, year
new_column_order = [4,1,0,2,3,]
df = df[df.columns[new_column_order]]
df.head()