본문 바로가기
파이썬

파이썬 이름 목록을 사용하여 Pandas Dataframe에서 열 이름을 변경하는 방법은 무엇입니까?

by º기록 2020. 10. 15.
반응형

이름 목록을 사용하여 팬더 데이터 프레임의 열 이름을 변경하려고했습니다. 다음 코드가 사용됩니다.

df.rename(columns = list_of_names, inplace=True)

그러나 매번 " list object is not callable "이라는 오류 메시지와 함께 유형 오류가 발생했습니다. I would like to know why does this happen? And What can I do to solve this problem? 도와 주셔서 감사합니다.

 

해결 방법

 

당신은 사용할 수 있습니다

df.columns = ['Leader', 'Time', 'Score']

 

참조 페이지 https://stackoverflow.com/questions/47343838

 

 

반응형

댓글