
[Python] ํผ๋ฒํ
์ด๋ธ
ยท
Python
ํผ๋ฒํ
์ด๋ธ์ด๋?ํผ๋ฒ(Pivot) ํ
์ด๋ธ์ด๋ ์๋ง์ ์์ ๋ฐ์ดํฐ ์์์ ํ์ํ ๋ฐ์ดํฐ๋ง ๋ฝ์ ์ ์๋ฏธํ ํ๋ฅผ ์์ฑํ๋ ๊ธฐ์ ์ด๋ค.์์
์์ ์ด ๊ธฐ๋ฅ์ด ์์ฃผ ์ฌ์ฉ๋๋ฉฐ Pandas๋ฅผ ์ด์ฉํด์ฌ์ฉ์ ์์๋๋ก ๋ฐ์ดํฐ๋ฅผ ํธ๋ค๋ง ํ ์ ์๋ค.data.pivot() | python์ ์ด์ฉํ ํผ๋ฒํ
์ด๋ธ ์์ฑ# ์์ ๋ฅผ ์ํ ๋ผ์ด๋ธ๋ฌ๋ฆฌ์ ๋ฐ์ดํฐ ๋ก๋import numpy as npimport pandas as pdimport seaborn as snstips = sns.load_dataset('tips')titanic = sns.load_dataset('titanic')iris = sns.load_dataset('iris')์์ ๋ฅผ ์ํด seaborn ๋ผ์ด๋ธ๋ฌ๋ฆฌ์์ ์ ๊ณตํ๋ tips ํ, iris ๊ฝ์ ๋ฐ์ดํฐ๋ฅผ ๋ก๋ํ๋ค.tips ๋ฐ..