• 카테고리

    질문 & 답변
  • 세부 분야

    데이터 분석

  • 해결 여부

    해결됨

FinanceDataReader를 통한 상장종목 전체 불러오기-futrewarning

21.05.16 16:24 작성 조회수 154

2

df_krx.describe() 코드를 실행하니까

<ipython-input-17-df5b081ceac7>:2: FutureWarning: Treating datetime data as categorical rather than numeric in `.describe` is deprecated and will be removed in a future version of pandas. Specify `datetime_is_numeric=True` to silence this warning and adopt the future behavior now.
  df_krx.describe() 라는 오류가 뜨네요.
(실행은 되는데 미래에는 문법이 사라진다는 건가요?)

답변 1

답변을 작성해보세요.

3

안녕하세요.

기존에는 describe를 하면 범주형 데이터로 기술통계값이 나왔었는데요. 미래버전에서는 범주형 값으로 다루지 않을 것이라는 경고 메시지로 공지사항 정도로 봐주시면 될것 같습니다.

그래서 경고메시지를 출력하지 않으려면 describe(datetime_is_numeric=True) 안에 datetime을 수치형 데이터로 보겠다는 옵션을 넣어달라는 메시지 입니다.

IEYEI님의 프로필

IEYEI

질문자

2021.05.19

 describe(datetime_is_numeric=True)  명령어를 사용하니 describe된 데이터가 날짜데이터만 출력되는데 어떻하나요?

안녕하세요.

모든 타입에 대한 기술통계 값을 보고 싶다면 

.describe(include="all")을 하면 모든 타입에 대한 기술통계 값을 가져오게 됩니다.

.describe(include="object") 를 하면 문자열 타입에 대한 기술통계 값을 가져오고요.

.describe(exclude="object") 를 하면 문자열을 제외한 타입에 대한 기술통계 값을 가져옵니다.

.describe(include="number") 를 하면 숫자타입에 대한 기술통계 값을 가져옵니다.