c6bd822
12022053 5 years ago
3 changed file(s) with 7 addition(s) and 27 deletion(s). Raw diff Collapse all Expand all
22 name: 行政区域面积1
33 value_type: float
44 description: 县(市)改区前1年行政区域面积(平方公里)
5 default: 123
56 行政区域面积2:
67 name: 行政区域面积2
78 value_type: float
246247 description: T县(市)改区 F非县(市)改区
247248 value_range:
248249 - T
249 - F
250 - F
00 import pandas as pd
1 import joblib
12 def handle(conf):
23 """
34 该方法是部署之后,其他人调用你的服务时候的处理方法。
136136 "metadata": {},
137137 "outputs": [],
138138 "source": [
139 "# pandas Python Data Analysis Library\n",
139 "# pandas 即 Python Data Analysis Library\n",
140140 "import pandas as pd\n",
141141 "import os\n",
142142 "\n",
473473 },
474474 "source": [
475475 "### 格式转换\n",
476 "将6行10列数据转换为1行60列,并保存在列表`yes_no_data`中\n",
476 "将6行10列表格数据转换为1行60列数据,保存在列表`yes_no_data`中\n",
477477 "\n",
478478 "同时将tag(y值)保存在列表`yes_no`中,县(市)改区 = '`T`', 非县(市)改区 = '`F`' \n"
479479 ]
12621262 },
12631263 {
12641264 "cell_type": "code",
1265 "execution_count": null,
1265 "execution_count": 1,
12661266 "metadata": {},
12671267 "outputs": [],
12681268 "source": [
12691269 "import pandas as pd\n",
1270 "import joblib\n",
12701271 "def handle(conf):\n",
12711272 " \"\"\"\n",
12721273 " 该方法是部署之后,其他人调用你的服务时候的处理方法。\n",
13081309 },
13091310 {
13101311 "cell_type": "code",
1311 "execution_count": 73,
1312 "metadata": {},
1313 "outputs": [
1314 {
1315 "name": "stdout",
1316 "output_type": "stream",
1317 "text": [
1318 " a b c\n",
1319 "0 1 2 3\n",
1320 " b c c\n",
1321 "0 2 3 3\n"
1322 ]
1323 }
1324 ],
1325 "source": [
1326 "df = pd.DataFrame({'a':1,'b':2,'c':3}, index=[0])\n",
1327 "print(df)\n",
1328 "df = df[['b','c','c']]\n",
1329 "print(df)"
1330 ]
1331 },
1332 {
1333 "cell_type": "code",
13341312 "execution_count": null,
13351313 "metadata": {},
13361314 "outputs": [],