본문 바로가기
Programming/python

[python] dataframe 의 column 순서변경

by 단창 2020. 2. 13.

cols = df.columns.tolist()

tmp = cols[10] #11번째 column을

del cols[10]

cols.insert(1,tmp) #2번째 위치로

df = df[cols]

 

반응형