Seaborn(Statistical Data Visualization)
통계를 기반으로 데이터 시각화를 지원해주는 파이썬 라이브러리
seaborn 사용하기
import시 오류발생 할 경우 - anaconda prompt에서 설치
1. anaconda Prompt cmd 창 로드
2. pip uninstall scipy
3. pip install scipy
4. pip uninstall seaborn
5. pip install seaborn
import pandas as pd
import seaborn as sns #import 모듈명 as 별칭
# seaborn 모듈에 저장된 데이터셋 목록보기
sns.get_dataset_names()
'''
['anagrams', 'anscombe', 'attention', 'brain_networks', 'car_crashes', \
'diamonds', 'dots', 'exercise', 'flights', 'fmri', 'gammas', 'geyser', 'iris', \
'mpg', 'penguins', 'planets', 'taxis', 'tips', 'titanic']
'''
seaborn 모듈 dataset 로드 (<class 'pandas.core.frame.DataFrame'>로 저장)
변수명 = sns.load_dataset("데이터셋 이름")
titanic=sns.load_dataset("titanic")
titanic 데이터(타이타닉 호) 컬럼들
survived 생존여부
pclass 좌석등급 (숫자)
sex 성별
age 나이
sibsp 형제자매 + 배우자 인원수
parch: 부모 + 자식 인원수
fare: 요금
embarked 탑승 항구
class 좌석등급 (영문)
who 성별
adult_male 성인남자여부
deck 선실 고유 번호 가장 앞자리 알파벳
embark_town 탑승 항구 (영문)
alive 생존여부 (영문)
alone 혼자인지 여부
mpg=sns.load_dataset("mpg")
mpg 데이터(자동차 연비 관련 데이터) 컬럼들
mpg
cylinders
displacement
horsepower
weight
acceleration
model_year
origin
name
'프로그래밍언어 > Python' 카테고리의 다른 글
[Python] 데이터 시각화-그래프연습 (python-pandas, matplotlib.pyplot, serborn) (0) | 2022.01.13 |
---|---|
[Python] 데이터 시각화 - 그래프 (0) | 2022.01.12 |
[Python] pandas 모듈 (0) | 2022.01.12 |
[Python] Numpy 모듈 (0) | 2022.01.11 |
[Python] 정규표현식(re 모듈) (0) | 2022.01.02 |