diff --git a/体测单位/淄博交警支队.ipynb b/体测单位/淄博交警支队.ipynb index d6b2e87..51ec3e6 100644 --- a/体测单位/淄博交警支队.ipynb +++ b/体测单位/淄博交警支队.ipynb @@ -213,16 +213,9 @@ }, { "cell_type": "code", - "execution_count": 76, + "execution_count": null, "id": "9aaa35a7-13e2-4ece-a9fd-931ad00e89d3", "metadata": { - "execution": { - "iopub.execute_input": "2022-10-18T09:22:24.792753Z", - "iopub.status.busy": "2022-10-18T09:22:24.792240Z", - "iopub.status.idle": "2022-10-18T09:22:24.824328Z", - "shell.execute_reply": "2022-10-18T09:22:24.823342Z", - "shell.execute_reply.started": "2022-10-18T09:22:24.792705Z" - }, "tags": [] }, "outputs": [], @@ -308,49 +301,12 @@ }, { "cell_type": "code", - "execution_count": 74, + "execution_count": null, "id": "5678472e-b131-4940-9161-240dcd3461bb", "metadata": { - "execution": { - "iopub.execute_input": "2022-10-18T09:18:04.991734Z", - "iopub.status.busy": "2022-10-18T09:18:04.991171Z", - "iopub.status.idle": "2022-10-18T09:18:05.041377Z", - "shell.execute_reply": "2022-10-18T09:18:05.040521Z", - "shell.execute_reply.started": "2022-10-18T09:18:04.991685Z" - }, "tags": [] }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "u_6300b7d4bc5a0_ayO3NftEDA 手机尾号3202用户 None 18705333202\n", - "u_lp_1663327661_63245dad5f702_I8JfuY 任振华 None 18705336366\n", - "u_6300b888d3aac_O39r6KCeML 王勇威 王勇威 18705336122\n", - "u_6300b8a21e3fe_zWo6UFSjrS 宗力 宗力 18705336363\n", - "u_lp_1663138566_63217b06daf80_S7mJ25 薛林 薛林 18705333903\n", - "u_lp_1664546227_6336f5b346d80_TiNiu1 房思春 房思春 18705333715\n", - "u_lp_1664617172_63380ad429dcb_svfFT3 海涛 祝学迎 18705336376\n", - "u_lp_1665641415_6347abc77a7ef_yV6Wox 董凯 董凯 15269362037\n", - "u_lp_1663406890_6325932a5caff_2RIkq2 祁河成 祁河成 18705333738\n", - "u_6325217365e69_WctQcZFuHb 张红海 张红海 18705333887\n", - "u_lp_1662620239_6319924fdf4a4_pB11t3 刘军 None 18705336318\n", - "u_lp_1661481758_6308331eaba3a_TQ1j6B 交警 翟峰 交警 翟峰 18705336675\n", - "u_lp_1663329993_632466c92bc76_uSmR9Q 孔晓晖 None 18705336315\n", - "u_lp_1663634037_63290a75694c9_cbt0Ld 王维军 快乐先行 18705336077\n", - "u_lp_1663649808_63294810ce3fd_UEPrNX 刘浩 刘浩 18705333203\n", - "u_lp_1663722388_632a6394b6954_7SupvO 李传生 李传生 18705336807\n", - "u_lp_1661486861_6308470de5d47_QzgTmI 张俊杰 张俊杰 18705336069\n", - "u_lp_1664162704_63311b90e964c_jPlmpl 童保华 None 18705333707\n", - "u_lp_1665036891_633e725b684d3_hsCm37 刘进 None 18705336031\n", - "u_lp_1663295972_6323e1e4caea7_fc1HXu 于会萍 None 18705333513\n", - "u_lp_1663325439_632454ff8b99b_DrUT6S 孙孝伟 None 18705336682\n", - "u_lp_1663577491_63282d93ea1e9_JDfOU8 王青海 王青海 18705336039\n", - "u_lp_1663663112_63297c08977aa_7gPZEP 车西冬 None 18705333710\n" - ] - } - ], + "outputs": [], "source": [ "import openpyxl\n", "import json\n", @@ -389,16 +345,9 @@ }, { "cell_type": "code", - "execution_count": 77, + "execution_count": null, "id": "c1a5aaef-70be-4fd2-9384-983aeb59f491", "metadata": { - "execution": { - "iopub.execute_input": "2022-10-18T09:22:39.019143Z", - "iopub.status.busy": "2022-10-18T09:22:39.018621Z", - "iopub.status.idle": "2022-10-18T09:22:39.175590Z", - "shell.execute_reply": "2022-10-18T09:22:39.174572Z", - "shell.execute_reply.started": "2022-10-18T09:22:39.019095Z" - }, "tags": [] }, "outputs": [], @@ -476,7 +425,7 @@ " list2 = [k,v['name'],v['phone'],v['unit'],dk,sc]\n", " list1.append(list2)\n", "title = ['昵称','姓名','手机号','部门','打卡次数','累计学习时长']\n", - "filename = 'data/交警支队学习情况表221018.xlsx'\n", + "filename = 'data/交警支队学习情况表221212.xlsx'\n", "wb = openpyxl.Workbook()\n", "sheet = wb.active\n", "sheet.append(title)\n", @@ -504,27 +453,12 @@ }, { "cell_type": "code", - "execution_count": 75, + "execution_count": null, "id": "a4886e66-99d1-4f24-9d53-29a239e62bad", "metadata": { - "execution": { - "iopub.execute_input": "2022-10-18T09:22:14.008683Z", - "iopub.status.busy": "2022-10-18T09:22:14.008151Z", - "iopub.status.idle": "2022-10-18T09:22:14.070260Z", - "shell.execute_reply": "2022-10-18T09:22:14.068944Z", - "shell.execute_reply.started": "2022-10-18T09:22:14.008634Z" - }, "tags": [] }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "ok\n" - ] - } - ], + "outputs": [], "source": [ "import openpyxl\n", "import json\n", @@ -610,75 +544,12 @@ }, { "cell_type": "code", - "execution_count": 57, + "execution_count": null, "id": "ee4bb827-287f-4b1f-8dbd-d595cb010892", "metadata": { - "execution": { - "iopub.execute_input": "2022-10-18T09:03:41.966475Z", - "iopub.status.busy": "2022-10-18T09:03:41.965956Z", - "iopub.status.idle": "2022-10-18T09:03:42.048247Z", - "shell.execute_reply": "2022-10-18T09:03:42.047389Z", - "shell.execute_reply.started": "2022-10-18T09:03:41.966426Z" - }, "tags": [] }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "1 u_6173e42182911_TnumhwOZG9 子墨 李文静 13718887655\n", - "2 u_6162ec35ad7b7_ey2oOCfUP7 小新卖蜡笔? 高峻超 17860246118\n", - "3 u_lp_1663297930_6323e98a33794_jNgzRD 冬日 冬日 \n", - "4 u_631899e2ad8f9_MhSqCAUX9R 手机尾号0101用户 伴着幸福的人 13605330101\n", - "5 u_6159638142ba1_S9otgjwjX7 宗瑾 宗瑾 18801062497\n", - "6 u_5f05c79ebb792_GDNNK8BWSI 奇奇 亓玉芬 15210715398\n", - "7 u_lp_1663134862_63216c8e0cf6d_5J5DmF 王青 王青 18615337165\n", - "8 u_lp_1663141739_6321876b2363b_S78cx0 霖山听海 霖山听海 \n", - "9 u_lp_1663326669_632459cda856f_GjFOVL 淄博最后的ikun 淄博最后的ikun \n", - "10 u_lp_1663413836_6325ae4cbb828_HSEYyB 妮妮 妮妮 13953380271\n", - "11 u_lp_1663554446_6327d38ef1069_MD1305 XZJ \n", - "12 u_lp_1664171121_63313c71a0f2f_fDvfoo 枕霞旧友 \n", - "13 u_lp_1664546227_6336f5b346d80_TiNiu1 房思春 房思春 \n", - "14 u_lp_1664617172_63380ad429dcb_svfFT3 海涛 祝学迎 13581027888\n", - "15 u_lp_1665225083_6341517b8211a_qiMkIj 阳光zj 阳光zj 13969307666\n", - "16 u_lp_1665641415_6347abc77a7ef_yV6Wox 董凯 董凯 13806481277\n", - "17 u_6319e7da6947f_GN6dmtH3ed 左登峰 左登峰 13964365877\n", - "18 u_lp_1663369088_6324ff80bc705_NgNTWu 我爱我家 \n", - "19 u_lp_1663406890_6325932a5caff_2RIkq2 祁河成 祁河成 \n", - "20 u_lp_1663136362_6321726a8403d_Ht7c9d 王洪珍 王洪珍 \n", - "21 u_6322e3966d41b_rVdSm1pZXH 驀然回首 驀然回首 15953356111\n", - "22 u_6325217365e69_WctQcZFuHb 张红海 张红海 13508951662\n", - "23 u_lp_1662620239_6319924fdf4a4_pB11t3 刘军 \n", - "24 u_lp_1663136658_6321739213909_ttFs3c 朱红霞 朱红霞 \n", - "25 u_lp_1661481758_6308331eaba3a_TQ1j6B 交警 翟峰 交警 翟峰 \n", - "26 u_lp_1663138780_63217bdc3fd19_e8t54f 顺其自然2 \n", - "27 u_lp_1663139478_63217e96c3954_EZvqh2 ???? ???? \n", - "28 u_lp_1664611559_6337f4e73b030_R1Og5Q ???? ???? 13287063721\n", - "29 u_633666862f1b1_XU3mwbtuGf 淬剑 \n", - "30 u_lp_1663119922_632132323da11_n9FmTv 王丽君 王丽君 13475518973\n", - "31 u_lp_1663124329_63214369d8508_N2CO9q 于立霞 于立霞 13953320629\n", - "32 u_lp_1663141198_6321854e76c00_Ab89tb 邓立群 邓立群 \n", - "33 u_lp_1663141485_6321866daf613_4NCc9M 耿晓龙 耿晓龙 \n", - "34 u_lp_1663329993_632466c92bc76_uSmR9Q 孔晓晖 \n", - "35 u_lp_1663551502_6327c80ec1d59_LP3Qr5 梦想成真 梦想成真 15264337301\n", - "36 u_lp_1663634037_63290a75694c9_cbt0Ld 王维军 快乐先行 13869376228\n", - "37 u_lp_1663649808_63294810ce3fd_UEPrNX 刘浩 刘浩 \n", - "38 u_lp_1663722388_632a6394b6954_7SupvO 李传生 李传生 13806431511\n", - "39 u_lp_1664653781_633899d5b97fb_LBp28e 淡若悠然 \n", - "40 u_lp_1661486861_6308470de5d47_QzgTmI 张俊杰 张俊杰 13655339406\n", - "41 u_lp_1664162704_63311b90e964c_jPlmpl 童保华 \n", - "42 u_lp_1665036891_633e725b684d3_hsCm37 刘进 \n", - "43 u_lp_1663142645_63218af5905c5_gqmABq 靥暖 \n", - "44 u_lp_1663225682_6322cf52dde88_qbC3Rs 许志国 \n", - "45 u_lp_1663295972_6323e1e4caea7_fc1HXu 于会萍 \n", - "46 u_lp_1663325439_632454ff8b99b_DrUT6S 孙孝伟 \n", - "47 u_lp_1663555784_6327d8c8c9e25_cLIVK4 便士 便士 \n", - "48 u_lp_1663577491_63282d93ea1e9_JDfOU8 王青海 王青海 \n", - "49 u_lp_1663663112_63297c08977aa_7gPZEP 车西冬 \n" - ] - } - ], + "outputs": [], "source": [ "import openpyxl\n", "import json\n", @@ -897,12 +768,32 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 12, "id": "65ef74b4-4667-422c-b610-63b517edd75d", "metadata": { + "execution": { + "iopub.execute_input": "2022-12-12T07:27:51.724770Z", + "iopub.status.busy": "2022-12-12T07:27:51.724234Z", + "iopub.status.idle": "2022-12-12T07:27:51.754962Z", + "shell.execute_reply": "2022-12-12T07:27:51.753806Z", + "shell.execute_reply.started": "2022-12-12T07:27:51.724722Z" + }, "tags": [] }, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "王冉冉 支队办公室 18705333037 ['《百日筑基', '《百日筑基']\n", + "甘斌发 高新区大队 18705333209 ['《百日筑基', '《百日筑基']\n", + "岳科学 桓台大队 18705332172 ['《百日筑基', '《百日筑基']\n", + "罗苓秋 支队办公室 18705333111 ['《百日筑基', '《百日筑基']\n", + "魏文静 支队救助办 18705333237 ['《百日筑基', '《百日筑基']\n", + "李溯影 支队政治处 18705333055 ['《百日筑基', '《百日筑基', '《百日筑基']\n" + ] + } + ], "source": [ "import json\n", "import os\n", @@ -910,13 +801,13 @@ "import csv\n", "import re\n", "\n", - "fi_path = 'data/交警支队/时长/'\n", + "fi_path = 'data/交警支队/打卡/'\n", "fl = glob.glob(f'{fi_path}*.csv')\n", "\n", "list1 = []\n", "dict1 = {}\n", "for fn in fl:\n", - " with open(fn,'r',newline='',encoding='gb18030') as csv_file:\n", + " with open(fn,'r',newline='') as csv_file:\n", " fl1 = csv.reader(csv_file,delimiter=',')\n", " zb = fn.split('-')[3]\n", " #header = next(fl1)\n", @@ -929,7 +820,7 @@ " dict1[m_id].append(zb)\n", " #list1.append(line)\n", " i +=1\n", - "filename = 'data/交警支队小鹅通信息.json'\n", + "filename = 'data/交警支队小鹅通信息221018.json'\n", "with open(filename,'r') as fl:\n", " dict2 = json.load(fl) \n", "dict3 = {}\n", diff --git a/数据处理.ipynb b/数据处理.ipynb index 2ec9045..b503d48 100644 --- a/数据处理.ipynb +++ b/数据处理.ipynb @@ -57,13 +57,6 @@ "cell_type": "code", "execution_count": null, "metadata": { - "execution": { - "iopub.execute_input": "2022-09-30T14:14:46.100665Z", - "iopub.status.busy": "2022-09-30T14:14:46.100139Z", - "iopub.status.idle": "2022-09-30T14:14:46.109863Z", - "shell.execute_reply": "2022-09-30T14:14:46.108679Z", - "shell.execute_reply.started": "2022-09-30T14:14:46.100616Z" - }, "tags": [] }, "outputs": [], @@ -83,29 +76,11 @@ }, { "cell_type": "code", - "execution_count": 38, + "execution_count": null, "metadata": { - "execution": { - "iopub.execute_input": "2022-10-02T01:11:16.449789Z", - "iopub.status.busy": "2022-10-02T01:11:16.449246Z", - "iopub.status.idle": "2022-10-02T01:11:16.458463Z", - "shell.execute_reply": "2022-10-02T01:11:16.457216Z", - "shell.execute_reply.started": "2022-10-02T01:11:16.449740Z" - }, "tags": [] }, - "outputs": [ - { - "data": { - "text/plain": [ - "('5', '10', '48')" - ] - }, - "execution_count": 38, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "import re\n", "t = '5小时10分48秒'\n", @@ -115,26 +90,11 @@ }, { "cell_type": "code", - "execution_count": 53, + "execution_count": null, "metadata": { - "execution": { - "iopub.execute_input": "2022-10-02T01:20:50.471217Z", - "iopub.status.busy": "2022-10-02T01:20:50.470675Z", - "iopub.status.idle": "2022-10-02T01:20:50.482522Z", - "shell.execute_reply": "2022-10-02T01:20:50.481212Z", - "shell.execute_reply.started": "2022-10-02T01:20:50.471168Z" - }, "tags": [] }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "[0, '10', '48']\n" - ] - } - ], + "outputs": [], "source": [ "import re\n", "t = '10分48秒'\n", @@ -156,13 +116,6 @@ "cell_type": "code", "execution_count": null, "metadata": { - "execution": { - "iopub.execute_input": "2022-09-30T14:22:32.892529Z", - "iopub.status.busy": "2022-09-30T14:22:32.892006Z", - "iopub.status.idle": "2022-09-30T14:22:32.900751Z", - "shell.execute_reply": "2022-09-30T14:22:32.898954Z", - "shell.execute_reply.started": "2022-09-30T14:22:32.892480Z" - }, "tags": [] }, "outputs": [], @@ -170,8 +123,45 @@ "import re\n", "\n", "s = '2022-09-28-《气郁组》-视频学习详情_155229'\n", - "m = re.findall(r'《(.+)》',s)\n", - "print(m)" + "m = re.findall(r'《(.+)》',s)\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 日期计算" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": { + "execution": { + "iopub.execute_input": "2022-12-09T03:42:01.099247Z", + "iopub.status.busy": "2022-12-09T03:42:01.098719Z", + "iopub.status.idle": "2022-12-09T03:42:01.108853Z", + "shell.execute_reply": "2022-12-09T03:42:01.106707Z", + "shell.execute_reply.started": "2022-12-09T03:42:01.099199Z" + }, + "tags": [] + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "33\n" + ] + } + ], + "source": [ + "import time\n", + "\n", + "birth = '1989-01-25'\n", + "t_birth = time.strptime(birth,'%Y-%m-%d')\n", + "days = (time.time() -time.mktime(t_birth))//(365*24*60*60)\n", + "print(int(days))" ] }, { @@ -700,7 +690,6 @@ { "cell_type": "markdown", "metadata": { - "jp-MarkdownHeadingCollapsed": true, "tags": [] }, "source": [ @@ -1267,52 +1256,6 @@ "\n" ] }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "tags": [] - }, - "outputs": [], - "source": [ - "import openpyxl\n", - "import json\n", - "import pymongo\n", - "\n", - "myclient = pymongo.MongoClient('mongodb://512song:songyi@192.168.3.100:27017/tice')\n", - "#dblist = myclient.list_database_names()\n", - "mydb = myclient['tice']\n", - " \n", - "collist = mydb. list_collection_names()\n", - "print(collist)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "tags": [] - }, - "outputs": [], - "source": [ - "import json\n", - "import pymongo\n", - "\n", - "myclient = pymongo.MongoClient('mongodb://10.147.17.6:27017/')\n", - "#dblist = myclient.list_database_names()\n", - "mydb = myclient['dayi']\n", - " \n", - "collist = mydb. list_collection_names()\n", - "print(collist)" - ] - }, { "cell_type": "markdown", "metadata": {}, @@ -1329,14 +1272,14 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 14, "metadata": { "execution": { - "iopub.execute_input": "2022-06-30T01:50:36.294943Z", - "iopub.status.busy": "2022-06-30T01:50:36.294429Z", - "iopub.status.idle": "2022-06-30T01:50:36.316866Z", - "shell.execute_reply": "2022-06-30T01:50:36.315497Z", - "shell.execute_reply.started": "2022-06-30T01:50:36.294897Z" + "iopub.execute_input": "2022-12-09T03:45:39.442887Z", + "iopub.status.busy": "2022-12-09T03:45:39.442350Z", + "iopub.status.idle": "2022-12-09T03:45:39.579904Z", + "shell.execute_reply": "2022-12-09T03:45:39.578629Z", + "shell.execute_reply.started": "2022-12-09T03:45:39.442840Z" }, "tags": [] }, @@ -1374,18 +1317,56 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], + "execution_count": 16, + "metadata": { + "execution": { + "iopub.execute_input": "2022-12-09T03:46:12.149945Z", + "iopub.status.busy": "2022-12-09T03:46:12.149314Z", + "iopub.status.idle": "2022-12-09T03:46:12.163591Z", + "shell.execute_reply": "2022-12-09T03:46:12.161659Z", + "shell.execute_reply.started": "2022-12-09T03:46:12.149895Z" + }, + "tags": [] + }, + "outputs": [ + { + "ename": "AttributeError", + "evalue": "'str' object has no attribute 'render_notebook'", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mAttributeError\u001b[0m Traceback (most recent call last)", + "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mbar\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mrender_notebook\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m", + "\u001b[0;31mAttributeError\u001b[0m: 'str' object has no attribute 'render_notebook'" + ] + } + ], "source": [ "bar.render_notebook()" ] }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], + "execution_count": 13, + "metadata": { + "execution": { + "iopub.execute_input": "2022-12-09T03:45:26.505194Z", + "iopub.status.busy": "2022-12-09T03:45:26.504668Z", + "iopub.status.idle": "2022-12-09T03:45:26.519538Z", + "shell.execute_reply": "2022-12-09T03:45:26.518053Z", + "shell.execute_reply.started": "2022-12-09T03:45:26.505147Z" + } + }, + "outputs": [ + { + "ename": "SyntaxError", + "evalue": "unexpected EOF while parsing (, line 31)", + "output_type": "error", + "traceback": [ + "\u001b[0;36m File \u001b[0;32m\"\"\u001b[0;36m, line \u001b[0;32m31\u001b[0m\n\u001b[0;31m .render(\"bar_histogram.html\")\u001b[0m\n\u001b[0m ^\u001b[0m\n\u001b[0;31mSyntaxError\u001b[0m\u001b[0;31m:\u001b[0m unexpected EOF while parsing\n" + ] + } + ], "source": [ "from pyecharts.globals import CurrentConfig, NotebookType\n", "CurrentConfig.NOTEBOOK_TYPE = NotebookType.JUPYTER_LAB\n", @@ -1419,6 +1400,13 @@ " .set_global_opts(title_opts=opts.TitleOpts(title=\"Bar-直方图\"))\n", " .render(\"bar_histogram.html\")\n" ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] } ], "metadata": {