## Q7(Program_Language): 칼럼번호 8~20 - others df21_Jp_PL = pd.DataFrame() df21_Jp_PL['Program_Language'] = [df21_Jp[col][1:].value_counts().index[0] for col in df21_Jp.columns[7:19]] df21_Jp_PL['counts'] = [df21_Jp[col][1:].value_counts().values[0] for col in df21_Jp.columns[7:19]]
## Q7(Program_Language): 칼럼번호 8~20 - others - Q7_Part12(None) df21_Ch_PL = pd.DataFrame() df21_Ch_PL['Program_Language'] = [df21_Ch_rmQ07P12[col][1:].value_counts() .index[0] for col in df21_Ch_rmQ07P12.columns[7:18]] df21_Ch_PL['counts'] = [df21_Ch_rmQ07P12[col][1:].value_counts() .values[0] for col in df21_Ch_rmQ07P12.columns[7:18]]
## 제거된 나라 칼럼과 value를 각각 삽입 및 통합 df21_Jp_PL.insert(0, 'Country', 'Japan') df21_Ch_PL.insert(0, 'Country', 'China')
## Q18(Program_Language): 칼럼번호 83~95 - others & other(text) df19_Jp_PL = pd.DataFrame() df19_Jp_PL['Program_Language'] = [df19_Jp[col][1:].value_counts().index[0] for col in df19_Jp.columns[82:93]] df19_Jp_PL['counts'] = [df19_Jp[col][1:].value_counts().values[0] for col in df19_Jp.columns[82:93]]
## 2019 China Q18_Part11(None) 결측값 제거 df19_Ch_rmQ18P11 = df19_Ch.drop(['Q18_Part_11'], axis='columns')
## Q18(Program_Language): 칼럼번호 83~95 - others & other(text) - Q18_Part11(None) df19_Ch_PL = pd.DataFrame() df19_Ch_PL['Program_Language'] = [df19_Ch_rmQ18P11[col][1:].value_counts() .index[0] for col in df19_Ch_rmQ18P11.columns[82:92]] df19_Ch_PL['counts'] = [df19_Ch_rmQ18P11[col][1:].value_counts() .values[0] for col in df19_Ch_rmQ18P11.columns[82:92]]