Skip to content

Commit ef2ec14

Browse files
committed
Update notebook files and modules
1 parent 9af63d0 commit ef2ec14

File tree

5 files changed

+10
-12
lines changed

5 files changed

+10
-12
lines changed

dataAnalysis/notebook/get_js_dict.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@
196196
" '''\n",
197197
" \n",
198198
" df = df.loc[df['module'].isna()] # 메서드, 함수 사용 데이터 추출\n",
199-
" df = df[df['function_method'] != 'None'] # 메서드, 함수 미사용 데이터 제거\n",
199+
" df = df[df['function_method'] != 'FunctionNotUsed'] # 메서드, 함수 미사용 데이터 제거\n",
200200
" df[\"problem_name\"] = df[\"problem_name\"].apply(lambda x: re.sub(\"\\(1\\)|\\s\", \"\", x)) # 문제이름(1)과 문제이름 => 동일 문제 처리\n",
201201
"\n",
202202
" # 중복 풀이된 고유 문제이름 리스트\n",
@@ -352,7 +352,7 @@
352352
"name": "python",
353353
"nbconvert_exporter": "python",
354354
"pygments_lexer": "ipython3",
355-
"version": "3.9.12"
355+
"version": "3.11.0"
356356
},
357357
"vscode": {
358358
"interpreter": {

dataAnalysis/notebook/get_py_dict.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@
196196
" '''\n",
197197
" \n",
198198
" df = df.loc[df['module'].isna()] # 메서드, 함수 사용 데이터 추출\n",
199-
" df = df[df['function_method'] != 'None'] # 메서드, 함수 미사용 데이터 제거\n",
199+
" df = df[df['function_method'] != 'FunctionNotUsed'] # 메서드, 함수 미사용 데이터 제거\n",
200200
" df[\"problem_name\"] = df[\"problem_name\"].apply(lambda x: re.sub(\"\\(1\\)|\\s\", \"\", x)) # 문제이름(1)과 문제이름 => 동일 문제 처리\n",
201201
"\n",
202202
" # 중복 풀이된 고유 문제이름 리스트\n",
@@ -381,7 +381,7 @@
381381
"name": "python",
382382
"nbconvert_exporter": "python",
383383
"pygments_lexer": "ipython3",
384-
"version": "3.9.12"
384+
"version": "3.11.0"
385385
}
386386
},
387387
"nbformat": 4,

dataAnalysis/notebook/visualize_data/_json_to_dataframe.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@ def unicode_err(df, column): # 회사명, 문제유형, 문제이름 중복 오
3434
'''
3535
unicodedata.normalize() 함수는 문자열에 있는 유니코드 문자를
3636
NFKC형식(문자열을 표준 호환성(KC) 형식으로 정규화)으로 정규화합니다.
37-
problem_name, problem_type, company_name 컬럼의 값 중 같은 값을
38-
파이썬에서 다르게 인식하는 문제를 해결합니다.
37+
컬럼의 값 중 같은 값을 파이썬에서 다르게 인식하는 문제를 해결합니다.
3938
4039
Args:
4140
data : (DataFrame | Series)
@@ -134,7 +133,7 @@ def json_to_df(json_file): # methodcount 와 method명을 분리하기 위함
134133
for file_name in data_json.keys():
135134
temp_df = pd.DataFrame(data_json[file_name])
136135
temp_df = temp_df.reset_index()
137-
df = pd.concat([df, temp_df], axis = 0)
136+
df = pd.concat([df, temp_df], axis = 0)
138137

139138
temp_df_len = len(temp_df) # countmethod가 0인 파일 사전 처리 후 concat
140139
if temp_df_len == 0:
@@ -175,9 +174,8 @@ def json_to_df(json_file): # methodcount 와 method명을 분리하기 위함
175174
for i in index_dict[index_key]:
176175
# df["problem_type"][i] = ptype
177176
df.loc[i, "problem_type"] = ptype
178-
179-
180-
df.loc[df["function_method"] == 0, "function_method"] = df.loc[df["function_method"] == 0, "function_method"].apply(lambda x: str(x).replace("0", "None")) # module 혹은 method를 사용하지 않은 경우 "None" 으로 대체
177+
178+
df.loc[df["function_method"] == 0, "function_method"] = df.loc[df["function_method"] == 0, "function_method"].apply(lambda x: str(x).replace("0", "FunctionNotUsed")) # module 혹은 method를 사용하지 않은 경우 "FunctionNotUsed" 으로 대체
181179

182180

183181
return df

dataAnalysis/notebook/visualize_data/js_get_dict.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ def drop_duplicated_solution(df):
182182
'''
183183

184184
df = df.loc[df['module'].isna()] # 메서드, 함수 사용 데이터 추출
185-
df = df[df['function_method'] != 'None'] # 메서드, 함수 미사용 데이터 제거
185+
df = df[df['function_method'] != 'FunctionNotUsed'] # 메서드, 함수 미사용 데이터 제거
186186
df["problem_name"] = df["problem_name"].apply(lambda x: re.sub("\(1\)|\s", "", x)) # 문제이름(1)과 문제이름 => 동일 문제 처리
187187

188188
# 중복 풀이된 고유 문제이름 리스트

dataAnalysis/notebook/visualize_data/py_get_dict.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ def drop_duplicated_solution(df):
194194

195195
df = df[df['problem_type'] != '구현']
196196
df = df.loc[df['module'].isna()] # 메서드, 함수 사용 데이터 추출
197-
df = df[df['function_method'] != 'None'] # 메서드, 함수 미사용 데이터 제거
197+
df = df[df['function_method'] != 'FunctionNotUsed'] # 메서드, 함수 미사용 데이터 제거
198198
df["problem_name"] = df["problem_name"].apply(lambda x: re.sub("\(1\)|\s", "", x)) # 문제이름(1)과 문제이름 => 동일 문제 처리
199199

200200
# 중복 풀이된 고유 문제이름 리스트

0 commit comments

Comments
 (0)