250x250
Link
๋์ GitHub Contribution ๊ทธ๋ํ
Loading data ...
Notice
Recent Posts
Recent Comments
์ผ | ์ | ํ | ์ | ๋ชฉ | ๊ธ | ํ |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 |
Tags
- ๋ฐ์ดํฐ๋ถ์์ ๋ฌธ๊ฐ
- ๋ฐ์ดํฐ๋ถ์์ค์ ๋ฌธ๊ฐ
- ADP
- ๋น ๋ฐ์ดํฐ๋ถ์๊ธฐ์ฌ
- PCA
- Python
- ์ค๋ฒ์ํ๋ง
- ๋ ๋ฆฝํ๋ณธ
- numpy
- ํ์ด์ฌ
- ๊ตฐ์งํ
- ADsP
- DBSCAN
- dataframe
- ์๋ํด๋ผ์ฐ๋
- iloc
- pandas
- ์ธ๋์ํ๋ง
- ๋น ๋ฐ์ดํฐ
- ํ ์คํธ๋ถ์
- t-test
- ๋ฐ์ดํฐ๋ถ๊ท ํ
- opencv
- LDA
- Lambda
- ๋์ํ๋ณธ
- ๋ฐ์ดํฐ๋ถ์
- datascience
- ์ฃผ์ฑ๋ถ๋ถ์
- ํฌ๋กค๋ง
Archives
Data Science LAB
[Python] Pandas๋ฅผ ์ด์ฉํ ์๊ฐํ ๋ณธ๋ฌธ
728x90
Pandas์ ์๊ฐํ ๊ธฐ๋ฅ — ๋ฐ์ดํฐ ์ฌ์ด์ธ์ค ์ค์ฟจ
Pandas์ ์๊ฐํ ๊ธฐ๋ฅ Pandas์ ์๋ฆฌ์ฆ๋ ๋ฐ์ดํฐํ๋ ์์ plot์ด๋ผ๋ ์๊ฐํ ๋ฉ์๋๋ฅผ ๋ด์ฅํ๊ณ ์๋ค. plot์ matplotlib๋ฅผ ๋ด๋ถ์์ ์ํฌํธํ์ฌ ์ฌ์ฉํ๋ค. np.random.seed(0) df1 = pd.DataFrame(np.random.randn(100, 3),
datascienceschool.net
import pandas as pd
np.random.seed(0)
df1 = pd.DataFrame(np.random.randn(100,3),
index=pd.date_range('1/1/2018', periods=100),
columns=['A',"B","C"]).cumsum()
df1.tail()
f1.plot()
plt.title('Pandas์ Plot ๋ฉ์๋ ์ฌ์ฉ ์')
plt.xlabel('์๊ฐ')
plt.ylabel('Data')
plt.show()
iris = sns.load_dataset('iris')
titanic = sns.load_dataset('titanic')
iris.sepal_length[:20].plot(kind='bar', rot=0)
plt.title('๊ฝ๋ฐ์นจ์ ๊ธธ์ด ์๊ฐํ')
plt.xlabel('data')
plt.ylabel('๊ฝ๋ฐ์นจ์ ๊ธธ์ด')
plt.show()
iris[:5].plot.bar(rot=0)
plt.title('Iris ๋ฐ์ดํฐ์ Bar Plot')
plt.xlabel('Data')
plt.ylabel('๊ฐ Feature ๊ฐ')
plt.ylim(0,7)
plt.show()
# ๊ฐ ๋ถ๊ฝ์ข
์ ํน์ง๊ฐ์ ํ๊ท
df2 = iris.groupby(iris.species).mean()
df2.columns.name='feature'
df2
df2.plot.bar(rot=0)
plt.title('๊ฐ ์ข
์ Feature๋ณ ํ๊ท ')
plt.xlabel('ํ๊ท ')
plt.ylabel('์ข
')
plt.ylim(0,8)
plt.show()
# ์ ์น์ฐ์ฐ์ผ๋ก ์๊ฐํ๋ฐฉ๋ฒ์ ๋ค๋ฅด๊ฒ ํํ
df2.T.plot.bar(rot=0)
plt.title('๊ฐ Feature์ ์ข
๋ณ ํ๊ท ')
plt.xlabel('Feature')
plt.ylabel('ํ๊ท ')
plt.show()
df3 = titanic.pclass.value_counts()
df3.plot.pie(autopct='%.2f%%')
plt.title('์ ์ค๋ณ ์น๊ฐ ์ ๋น์จ')
plt.axis('equal')
plt.show()
iris.plot.hist()
plt.title('๊ฐ Feature ๊ฐ๋ค์ ๋น๋์ Histogram')
plt.xlabel('๋ฐ์ดํฐ ๊ฐ')
plt.show()
iris.plot.box()
plt.title('๊ฐ Feature ๊ฐ๋ค์ ๋น๋์์ ๋ํ Box Plot')
plt.xlabel('Feature')
plt.ylabel('๋ฐ์ดํฐ ๊ฐ')
plt.show()
728x90
'๐ Python > ์๊ฐํ' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[Python] Matplotlib ์๊ฐํ (0) | 2022.09.22 |
---|---|
[Python] Mac์์ Matplotlib ํ๊ธ ๊นจ์ง ํ์ ํด๊ฒฐ ๋ฐฉ๋ฒ (0) | 2022.09.20 |
[Python] matplotlib ํ๊ธ ๊นจ์ง ๋ฐฉ์ง, ํ๊ธ ์ถ๋ ฅ ๋ฐฉ๋ฒ (0) | 2022.08.26 |
[Python] matplotlib subplots ์ฌ์ฉ(์ฌ๋ฌ๊ฐ์ ๊ทธ๋ํ๋ฅผ ํ๋ฒ์) (0) | 2022.08.23 |
Comments