전체 글 (102) 썸네일형 리스트형 07_07_43. chi-square test (카이제곱 검정) import pandas as pd from scipy.stats import chisquare import scipy.stats as stats # df라는 데이터프레임에 x7_2, x5라는 변수가 존재한다고 했을 때! result_31=pd.crosstab(df.x7_2, df.x5) result_31_chi, p, dof, ex = stats.chi2_contingency(observed=result_31) # p : p-value chi-square test [Hive] 04. 날짜 다루기 (string -> date) string 형태로 된 날짜값을 날짜type으로 변경하기!! select from_unixtime(unix_timestamp(string_col, 'yyyymmdd'), 'yyyy-mm-dd') # 2020-01-01 ,from_unixtime(unix_timestamp(string_col, 'yyyymmdd'), 'yyyymmdd') # 20200101 from table ; 07_01_42. replace를 이용한 컬럼명 변경 (replace string in list) # 컬럼명 replace로 변경 ( item -> delv로 변경) df_delv_01.columns = [x.replace('item','delv') for x in df_delv_01.columns] 이전 1 ··· 11 12 13 14 15 16 17 ··· 34 다음