The following graphs are the codes for the figures included in Chapter 4 of the e-book Statistics with Python . import numpy as np import pandas as pd from scipy import stats from sklearn.preprocessing import StandardScaler import yfinance as yf import matplotlib.pyplot as plt import seaborn as sns sns.set_style("darkgrid") # fig 421 st=pd.Timestamp(2022,12, 1) et=pd.Timestamp(2023, 4, 1) da=yf.download("^DJI", st, et) pop=(da['Close']-da['Open'])/da['Open']*100 pop.columns=['change'] pop.index=pd.DatetimeIndex(pop.index.date) xBar=np.array([]) for i in range(20): x=pop.sample(5, replace=False, random_state=i) xBar=np.append(xBar, x.mean()) xBar2=np.array([]) for i in range(100): x=pop.sample(5, replace=False, random_state=i) xBar2=np.append(xBar2, x.mean()) plt.figure(figsize=(7, 3)) plt.subplot(1,2,1) plt.hist(xBar, 10, rwidth=0.8, color="blue", label="n=20") plt.axvline(-0.18, 0, 0.9, color=...
python 언어를 적용하여 통계(statistics)와 미적분(Calculus), 선형대수학(Linear Algebra)을 소개합니다. 이 과정에서 빅데이터를 다루기 위해 pytorch를 적용합니다.