Skip to content

Instantly share code, notes, and snippets.

@mols3131d
Last active May 13, 2024 08:14
Show Gist options
  • Save mols3131d/de772f360cebfdc979c811c237129946 to your computer and use it in GitHub Desktop.
Save mols3131d/de772f360cebfdc979c811c237129946 to your computer and use it in GitHub Desktop.
Pandas
"""
select_dtypes() 함수의 include 매개변수에 올 수 있는 것들은 다음과 같습니다.
"number": 숫자형 데이터 유형
"bool": 부울형 데이터 유형
"object": 오브젝트형 데이터 유형
"category": 카테고리형 데이터 유형
"datetime64[ns]": 날짜/시간 데이터 유형
"timedelta64[ns]": 시간 간격 데이터 유형
"string": 문자열 데이터 유형
"bytes": 바이트 데이터 유형
"categorical": 카테고리형 데이터 유형(object 또는 category와 동일)
"""
df.describe()
df.describe(include=["object", "category"])
df.describe(include="datetime")
numeric_columns = df.select_dtypes(include="number").columns.to_list()
categorical_columns = df.select_dtypes(include=["object", "category"]).columns.to_list()
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment