1. 程式人生 > >python 列表標題重新命名

python 列表標題重新命名

import pandas as pd
import re

f1=pd.read_excel('01.xlsx')

f1.columns
#Index(['A', 'B'], dtype='object')

f1.columns=['C',"D"]     #重新命名

f1.columns
#Index(['C', 'D'], dtype='object')