This commit is contained in:
512song@sina.com committed 2022-12-12 15:36:48 +08:00
1 parent 20146bccbd
commit 2043c814a1
2 files changed
+134 -255

No files matched your search

+100 -112
View File
@@ -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<ipython-input-16-fc8263bd7096>\u001b[0m in \u001b[0;36m<module>\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 (<ipython-input-13-aff59bd6347d>, line 31)",
"output_type": "error",
"traceback": [
"\u001b[0;36m File \u001b[0;32m\"<ipython-input-13-aff59bd6347d>\"\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": {