对DataFrame数据按列处理 获取列名使用.columns()函数。 import pandas as pd df=pd.DataFrame({ 'id':[1,2,3,4,5],'a':[1, 3, 5, 7,9],'b':[2