์ผ | ์ | ํ | ์ | ๋ชฉ | ๊ธ | ํ |
---|---|---|---|---|---|---|
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 |
- ๋ฐ์ดํฐ๋ถ์์ ๋ฌธ๊ฐ
- Lambda
- dataframe
- t-test
- ์ธ๋์ํ๋ง
- ADsP
- numpy
- iloc
- ๋ ๋ฆฝํ๋ณธ
- PCA
- LDA
- ๊ตฐ์งํ
- DBSCAN
- ํ์ด์ฌ
- ์ฃผ์ฑ๋ถ๋ถ์
- ๋น ๋ฐ์ดํฐ๋ถ์๊ธฐ์ฌ
- ๋ฐ์ดํฐ๋ถ์์ค์ ๋ฌธ๊ฐ
- ์๋ํด๋ผ์ฐ๋
- datascience
- ๋ฐ์ดํฐ๋ถ๊ท ํ
- ADP
- ๋์ํ๋ณธ
- ํ ์คํธ๋ถ์
- ์ค๋ฒ์ํ๋ง
- Python
- ๋น ๋ฐ์ดํฐ
- pandas
- opencv
- ๋ฐ์ดํฐ๋ถ์
- ํฌ๋กค๋ง
๋ชฉ๋ก๐ Python (45)
Data Science LAB
1. re.sub() ๋ชจ๋ ์ซ์๋ค์ 1๊ฐ์ ๋ฌธ์์ด๋ก ์ถ์ถ sub()๋ String์์ pattern๊ณผ ์ผ์นํ๋ ๋ฌธ์๋ค์ repl๋ก ๊ต์ฒด re.sub(pattern, repl, string) import re string = 'abc1234abc' num = re.sub(r'[^0-9]', '', string) print(num) # 1234 2. re.findall() - r'\d+' string์์ pattern์ ํด๋นํ๋ ๋ด์ฉ๋ค์ ์ฐพ์์ ๋ฆฌ์คํธ๋ก ๋ฆฌํด r'\d+'๋ 1ํ ์ด์ ๋ฐ๋ณต๋๋ ์ซ์๋ค์ ๋ํ ํจํด์ ์๋ฏธ ์ฐ์๋ ์ซ์๋ค์ ํ๋์ Integer๋ก ์ถ์ถ string = 'aab 1234, 543 bbc' num = re.findall(r'\d+', string) print(num) # ['1234'..
ํ์ด์ฌ์์ ์์์ ์ดํ์ ์ซ์๋ฅผ ๋ฒ๋ฆฌ๊ณ ์ ์ ๋ถ๋ถ๋ง ๋จ๊ธธ ๋ ์ฌ์ฉํ ์ ์๋ ๋ฐฉ๋ฒ 1. round() ํจ์๋ก ์์์ ์๋ ์ซ์ ๋ฐ์ฌ๋ฆผ print(round(3.14)) print(round(3.9)) # 3 # 4 2. ceil() ํจ์๋ก ์์์ ์๋ ์ซ์ ์ฌ๋ฆผ print(math.ceil(3.14)) print(math.ceil(3.9)) # 4 # 4 3. floor() ํจ์๋ก ์์์ ์๋ ์ซ์ ๋ด๋ฆผ print(math.floor(3.14)) print(math.floor(3.9)) # 3 # 3 4. trunc()ํจ์๋ก ์์์ ์๋ ์ซ์ ๋ฒ๋ฆผ print(math.trunc(3.14)) print(math.trunc(3.9)) # 3 # 3 # trunc() ํจ์์ floor()ํจ์์ ์ฐจ์ด์ floo..
Class ๋ ํฌ๊ฒ ์์ฑ / ๋ฉ์๋๋ก ๊ตฌ์ฑ - ๋ฉ์๋ : ๊ธฐ๋ฅ์ ํ๋ ํจ์ - ์์ฑ : ๋ฐ์ดํฐ Person์ด๋ผ๋ ํด๋์ค๊ฐ ์์ ๋, ์ด๋ฆ, ๋์ด, ์ง์ ๋ฑ์ ์ ๋ณด๊ฐ ์์ฑ์ด๊ณ ์๊ธฐ์๊ฐ์ ๊ฐ์ ๊ธฐ๋ฅ์ด ๋ฉ์๋ ์ฌ๊ธฐ์ self๋ ์๊ธฐ ์์ , ์ฆ ์ธ์คํด์ค๋ฅผ ์๋ฏธํ๋ค. class Person(): def __init__(self,name,age,job): self.name = name self.age = age self.job = job Class ๊ตฌ์ฑ ์ ์ฅ์ - ๊ธ๋ก๋ฒ ๋ณ์๋ฅผ ์์ ๊ณ , ๋ชจ๋ ๋ณ์๋ฅผ ์ด๋ ํ ์ค์ฝํ์ ์์์ํด - ๋ช ๋ฒ์ด๊ณ ์ฌ์ฌ์ฉ ๊ฐ๋ฅ - ์ฝ๋ ์์ ์ต์ํ - ํจ์ ์คํ ์ค, ํจ์ ์์ ์ ๋ค์ ํธ์ถํ๋ ์ฒ๋ฆฌ ๋ฑ์ด ๊ฐ๋ฅ __init__ - ์ปจ์คํธ๋ญํฐ๋ผ๊ณ ๋ถ๋ฆฌ๋ ์ด๊ธฐํ๋ฅผ ์ํ ํจ์(๋ฉ์๋) - ์ธ์คํด์ค..

์ ๊ทธ๋ํ import matplotlib.pyplot as plt import matplotlib as mpl %matplotlib inline plt.title('Plot') plt.plot([1,4,9,16]) plt.show() ์ ๋ชฉ ์ค์ plt.title('x ticks') plt.plot([10,20,30,40], [1,4,9,16]) plt.show() ํ๊ธ ์ค์ (Mac) # ํฐํธ ์ค์ mpl.rc('font', family='NanumGothic') #์ ๋์ฝ๋์์ ์์ ๋ถํธ ์ค์ mpl.rc('axes', unicode_minus=False) ์คํ์ผ ์ง์ # ์คํ์ผ ์ง์ plt.title('rs style') plt.plot([10,20,30,40], [1,4,9,16], 'rs--') p..

https://datascienceschool.net/01%20python/05.05%20%ED%8C%90%EB%8B%A4%EC%8A%A4%EC%9D%98%20%EC%8B%9C%EA%B0%81%ED%99%94%20%EA%B8%B0%EB%8A%A5.html 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 = p..

import seaborn as sns import matplotlib.pyplot as plt from matplotlib import rc %matplotlib inline rc('font', family='AppleGothic') # font๋ ๋ค๋ฅธ ๊ฒ์ผ๋ก๋ ์ค์ ๊ฐ๋ฅ plt.rcParams['axes.unicode_minus'] = False ์์ ๊ฐ์ด ํ๊ธ์ด ๊นจ์ง์ง ์๊ณ ์ ์ถ๋ ฅ๋๋ค