1. ν° μμ λ²μΉ
df3.describe() # λλ΅μ μΈ λ°μ΄ν°μ λͺ¨μλ₯Ό νμΈν©λλ€.
λλ΅ 5000κ°λ§ κ°λ κ°μ΄ λΉμ·ν΄μ§λ κ²μ νμΈν μ μμ΅λλ€.
dat = []
np.random.seed(42)
for i in np.arange(start = 0, stop = 18000, step = 100) :
s = np.random.choice(df3, i)
dat.append(s.var())
dat
(pd
.DataFrame(dat)
.plot
.line(color = '#4000c7')
.axhline(y = 192, color = '#00da75')
);
νλ³Έμ μκ° λ§μμ§μλ‘ μ μ°¨ λΆμ°κ°μ΄ μλ ΄νλ λͺ¨μ΅μ νμΈνμμ΅λλ€.
2. μ€μ¬κ·Ήνμ 리
sample_means = []
for x in range(0, 1000):
coinflips = np.random.choice(df3, 1000)
sample_means.append(coinflips.mean())
pd.DataFrame(sample_means).hist(color = '#4000c7'); # 1000κ°μ© 1000λ² λ½μ κ²½μ°
sample_means2 = []
for x in range(0, 10000):
coinflips = np.random.choice(df3, 1000)
sample_means2.append(coinflips.mean())
pd.DataFrame(sample_means2).hist(color = '#4000c7'); # 1000κ°μ© 10000λ² λ½μ κ²½μ°
νμ€ν μ’λ μ κ·λΆν¬μ κ°κΉμμ§λ κ²μ νμΈν μ μμμ΅λλ€.
μ΄μμ λλ€. κ°μ¬ν©λλ€. :)
'πΏ Data > μ΄λͺ¨μ λͺ¨' μΉ΄ν κ³ λ¦¬μ λ€λ₯Έ κΈ
Simple Linear Regression(λ¨μμ ννκ·) (0) | 2021.12.17 |
---|---|
λ² μ΄μ§μ μμ νμ΄(Bayesian Problem example) (0) | 2021.12.10 |
ANOVA μμ, μ¬λ¬ μνλ§ (0) | 2021.12.10 |
Python λ―ΈλΆ (0) | 2021.12.10 |
λ°μ΄ν° μ 리 λ° μκ°ν μμ κΈ°λ‘ (0) | 2021.12.10 |