❤️여존슨- 박스콕스
from sklearn.preprocessing import power_transfrom
df['y'] = power_transform(df['col'])
df['b'] = power_transform(df['col'], method = box-cox )

from scipy import stats
yeo = stats.yeojohnson(df['col'])
box = stats.boxcox(df['col'])

❤️ 표준화1
from sklearn.preprocessing import StandardScaler
scaler =  StandardScaler()
 # 하나의 컬럼만 표준화할때는 대괄호 두개
df['col2'] = scaler.fit_transform(df[['col']])

# 수치형 데이터프레임을 전부 표준화 할때
scaled_df = scaler.fit_transform(df)

❤️ 표준화2 - min-max표준화
from sklearn.preprocessing import MinMaxScaler
scaler = MinMaxScaler()
df['col2'] = scaler.fit_transform(df[[col]])


❤️ 그룹바이 
~ 별로 라고하면 ~라고 나온것을 묶기
#  조건을 걸 컬럼을 데이터프레임으로 유지하기위해 대괄호 두개
df = df.groupby(['city', 'f4'])[['f5']].mean()

오름차순 : ascending = True (작은것 -> 큰것)
내림차순 : ascending = False (큰것 -> 작은것)

❤️ 요일 
df.dayofweek
# 주말
df['weekend'] = df['dayofweek'] >= 5
# 평일
df['weekday'] = ~df['dayofweek'] 

❤️ 주 단위
df_w = df.resample('W', on = 'Date')['Sales'].sum()

❤️ 시차
df['lag'] = df['col'].shift(1)

❤️ pd.melt : 열로 합치기
❤️ 정수형 : int 
❤️ 반올림 : round
❤️ 올림 : np.ceil
❤️ 내림 : np.floor
❤️ 버림 : np.trunc

❤️ df['col'] = np.where[cond, 맞을시, 아닐시]

 

❤️pd.merge(left = '', right = '' , on = 'f4', how='')