Skip to content

Commit 8014ef6

Browse files
committed
modified the config for service_key
1 parent 8f6134b commit 8014ef6

File tree

1 file changed

+94
-0
lines changed

1 file changed

+94
-0
lines changed

realestate/road_code_extract.ipynb

+94
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": 2,
6+
"metadata": {},
7+
"outputs": [],
8+
"source": [
9+
"f_in = open('road_code_total.txt', 'r')\n",
10+
"lines = [x[:-1] for x in f_in.readlines()]"
11+
]
12+
},
13+
{
14+
"cell_type": "code",
15+
"execution_count": 3,
16+
"metadata": {},
17+
"outputs": [
18+
{
19+
"data": {
20+
"text/plain": [
21+
"'11110|2005001|세종대로|Sejong-daero|00|서울특별시|종로구|2|||||0|||Seoul|Jongno-gu||20100520|'"
22+
]
23+
},
24+
"execution_count": 3,
25+
"metadata": {},
26+
"output_type": "execute_result"
27+
}
28+
],
29+
"source": [
30+
"lines[0]"
31+
]
32+
},
33+
{
34+
"cell_type": "code",
35+
"execution_count": 7,
36+
"metadata": {},
37+
"outputs": [
38+
{
39+
"data": {
40+
"text/plain": [
41+
"['11110', '2005001', '세종대로', '00', '서울특별시', '종로구']"
42+
]
43+
},
44+
"execution_count": 7,
45+
"metadata": {},
46+
"output_type": "execute_result"
47+
}
48+
],
49+
"source": [
50+
"results = []\n",
51+
"for line in lines:\n",
52+
" values = line.split('|')\n",
53+
" cols = [1, 2, 3, 5, 6, 7]\n",
54+
" data = [values[col-1] for col in cols]\n",
55+
" results.append(data)\n",
56+
" \n",
57+
"results[0]"
58+
]
59+
},
60+
{
61+
"cell_type": "code",
62+
"execution_count": 8,
63+
"metadata": {},
64+
"outputs": [],
65+
"source": [
66+
"f_out = open('road_codes.csv', \"w\")\n",
67+
"for result in results:\n",
68+
" f_out.write(\",\".join(result) + \"\\n\")\n",
69+
"f_out.close()\n"
70+
]
71+
}
72+
],
73+
"metadata": {
74+
"kernelspec": {
75+
"display_name": "Python 3",
76+
"language": "python",
77+
"name": "python3"
78+
},
79+
"language_info": {
80+
"codemirror_mode": {
81+
"name": "ipython",
82+
"version": 3
83+
},
84+
"file_extension": ".py",
85+
"mimetype": "text/x-python",
86+
"name": "python",
87+
"nbconvert_exporter": "python",
88+
"pygments_lexer": "ipython3",
89+
"version": "3.7.4"
90+
}
91+
},
92+
"nbformat": 4,
93+
"nbformat_minor": 1
94+
}

0 commit comments

Comments
 (0)