JupyterLab/.ipynb_checkpoints/同桌100数据格式化-checkpoint.ipynb
2024-01-18 21:11:41 +08:00

189 lines
6.0 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{
"cells": [
{
"cell_type": "code",
"execution_count": 20,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"id\n",
"title\n",
"sphoto\n",
"teacher\n",
"Photonames\n",
"url\n",
"checkfree\n",
"playtime\n",
"svisited\n",
"sequens\n",
"sdate\n",
"id\n",
"title\n",
"sphoto\n",
"teacher\n",
"Photonames\n",
"url\n",
"checkfree\n",
"playtime\n",
"svisited\n",
"sequens\n",
"sdate\n",
"id\n",
"title\n",
"sphoto\n",
"teacher\n",
"Photonames\n",
"url\n",
"checkfree\n",
"playtime\n",
"svisited\n",
"sequens\n",
"sdate\n",
"id\n",
"title\n",
"sphoto\n",
"teacher\n",
"Photonames\n",
"url\n",
"checkfree\n",
"playtime\n",
"svisited\n",
"sequens\n",
"sdate\n",
"id\n",
"title\n",
"sphoto\n",
"teacher\n",
"Photonames\n",
"url\n",
"checkfree\n",
"playtime\n",
"svisited\n",
"sequens\n",
"sdate\n"
]
}
],
"source": [
"import json\n",
"json_str='''\n",
"{\n",
" \"status\": 1,\n",
" \"responsedata\": {\n",
" \"videoclass\": \"\",\n",
" \"page\": \"1\",\n",
" \"num\": 5,\n",
" \"records\": \"14382\",\n",
" \"totalpage\": 2877,\n",
" \"rows\": [\n",
" {\n",
" \"id\": \"158075\",\n",
" \"title\": \"三年级数学下册第六章《保护大天鹅——三位数乘两位数》乘法估算\",\n",
" \"sphoto\": \"https://image.tongzhuo100.com/video/15a7d1fe2171f438a68d95d875c53eba.jpg\",\n",
" \"teacher\": \"王老师\",\n",
" \"Photonames\": \"1612859389.mp4\",\n",
" \"url\": \"http://www.tongzhuo100.com/v/2021-02/158075.html\",\n",
" \"checkfree\": \"0\",\n",
" \"playtime\": \"00:27:45\",\n",
" \"svisited\": \"1000000\",\n",
" \"sequens\": \"24\",\n",
" \"sdate\": \"1612859417\"\n",
" },\n",
" {\n",
" \"id\": \"158073\",\n",
" \"title\": \"一年级数学下册 期末复习 四\",\n",
" \"sphoto\": \"https://image.tongzhuo100.com/video/26a7d4a193afaaa874366d4263b251a7.jpg\",\n",
" \"teacher\": \"冯老师\",\n",
" \"Photonames\": \"1612857570.mp4\",\n",
" \"url\": \"http://www.tongzhuo100.com/v/2021-02/158073.html\",\n",
" \"checkfree\": \"0\",\n",
" \"playtime\": \"00:22:19\",\n",
" \"svisited\": \"1000000\",\n",
" \"sequens\": \"57\",\n",
" \"sdate\": \"1612857611\"\n",
" },\n",
" {\n",
" \"id\": \"158072\",\n",
" \"title\": \"一年级数学下册 期末复习 三\",\n",
" \"sphoto\": \"https://image.tongzhuo100.com/video/3e30ca43993fcd8ed8d014186f7d6744.jpg\",\n",
" \"teacher\": \"冯老师\",\n",
" \"Photonames\": \"1612857453.mp4\",\n",
" \"url\": \"http://www.tongzhuo100.com/v/2021-02/158072.html\",\n",
" \"checkfree\": \"0\",\n",
" \"playtime\": \"00:24:21\",\n",
" \"svisited\": \"1000000\",\n",
" \"sequens\": \"56\",\n",
" \"sdate\": \"1612857505\"\n",
" },\n",
" {\n",
" \"id\": \"158071\",\n",
" \"title\": \"一年级数学下册 期末复习 二\",\n",
" \"sphoto\": \"https://image.tongzhuo100.com/video/3bd6e906c775cbc77c8b9f613f3f155e.jpg\",\n",
" \"teacher\": \"冯老师\",\n",
" \"Photonames\": \"1612857153.mp4\",\n",
" \"url\": \"http://www.tongzhuo100.com/v/2021-02/158071.html\",\n",
" \"checkfree\": \"0\",\n",
" \"playtime\": \"00:15:32\",\n",
" \"svisited\": \"1000000\",\n",
" \"sequens\": \"55\",\n",
" \"sdate\": \"1612857384\"\n",
" },\n",
" {\n",
" \"id\": \"158070\",\n",
" \"title\": \"一年级数学下册 第六单元《100以内的加法和减法》复习2\",\n",
" \"sphoto\": \"https://image.tongzhuo100.com/video/d87bdd7c2f1bffb2552ed6443d6409bf.jpg\",\n",
" \"teacher\": \"冯老师\",\n",
" \"Photonames\": \"1612857034.mp4\",\n",
" \"url\": \"http://www.tongzhuo100.com/v/2021-02/158070.html\",\n",
" \"checkfree\": \"0\",\n",
" \"playtime\": \"00:22:35\",\n",
" \"svisited\": \"1000000\",\n",
" \"sequens\": \"53\",\n",
" \"sdate\": \"1612857090\"\n",
" }\n",
" ]\n",
" },\n",
" \"error\": \"\"\n",
"}\n",
"'''\n",
"rows = json.loads(json_str)['responsedata']['rows']\n",
"#print (data2['data']['playarray'])\n",
"for row in rows:\n",
" for value in row:\n",
" print(row[value])"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.4"
}
},
"nbformat": 4,
"nbformat_minor": 2
}