Data Science/데이터셋

파이썬 데이터 샘플 불러오기 seaborn.load_dataset (titanic 외 18)

상어군 2021. 11. 3. 02:36
반응형

데이터 분석 또는 시각화를 연습하거나 예시를 들때 그 재료가될 데이터가 필요하다.

seaborn 라이브러리에서는 이럴 때 사용할 수 있는 데이터를 간편하게 제공하고 있다.

기본적으로 19개의 csv파일이 제공되며 그외에 이미지 등도 제공된다.

본 포스팅에서는 기본적으로 제공되는 19개의 csv 파일을 다룬다.

 

1. seaborn.load_dataset

데이터를 호출하는 함수 이름은 load_dataset이다.

인자로는 단순히 데이터의 이름을 입력한다.

import seaborn as sns

sns.load_dataset('데이터셋 이름')

2. 데이터 호출하기

2.1 아이리스 꽃 데이터(Iris)

import seaborn as sns

df = sns.load_dataset('iris')

2.2 타이타닉 데이터(Titanic)

import seaborn as sns

df = sns.load_dataset('titanic')

2.3 팁 데이터(Tips)

import seaborn as sns

df = sns.load_dataset('tips')

2.4 택시 요금 데이터(Taxis)

import seaborn as sns

df = sns.load_dataset('taxis')

3. 그 외의 데이터셋 목록

데이터셋 이름 데이터셋 이름
anagrams anscombe
attention brain_networks
car_crashes diamonds
dots exercise
flights fmri
gammas geyser
iris mpg
penguins planets
taxis tips
titanic  

 

 

4. 참고문헌

https://seaborn.pydata.org/generated/seaborn.load_dataset.html

 

seaborn.load_dataset — seaborn 0.11.2 documentation

If True, try to load from the local cache first, and save to the cache if a download is required.

seaborn.pydata.org

https://github.com/mwaskom/seaborn-data

 

GitHub - mwaskom/seaborn-data: Data repository for seaborn examples

Data repository for seaborn examples. Contribute to mwaskom/seaborn-data development by creating an account on GitHub.

github.com

 

반응형