강의

멘토링

커뮤니티

Inflearn Community Q&A

allma1234211's profile image
allma1234211

asked

Getting started with data analysis with Kaggle surveys

[4/13] 🌏 Where does Kaggler live and what does he do?! - Reducing repetitive tasks with functions (1)

order를 함수 내에서 만들고 싶어서

Written on

·

179

1

강의에서는 q1_cols라고 따로 윗 블럭에 만든다음에 order=q1_cols라고 지정해 주었었는데

제가 한것 처럼 함수 내에서 cols를 만들면 안되나요 ㅠㅠㅠ?

pandasseabornkaggle

Answer 1

1

todaycode님의 프로필 이미지
todaycode
Instructor

안녕하세요.

가장 마지막 줄에서 함수를 부를 때 cols 라는 변수를 사용하는데 해당 함수를 부르기 전에 cols 를 만들어 주어야 합니다.

cols 가 없는 상태로 함수에 전달해서 오류가 난거에요.

cols 를 정의할 때 함수 안이 아니라 함수를 부르기 전에 함수 바깥에서 만들어 주세요!

allma1234211's profile image
allma1234211

asked

Ask a question