沥青定量定性2月数据修复

This commit is contained in:
workpc 2025-03-03 17:54:15 +08:00
parent b60a1016ab
commit eb3d770920
9 changed files with 891 additions and 106 deletions

View File

@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
"execution_count": 25,
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
@ -967,7 +967,7 @@
},
{
"cell_type": "code",
"execution_count": 26,
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
@ -1000,7 +1000,7 @@
},
{
"cell_type": "code",
"execution_count": 27,
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
@ -1050,70 +1050,737 @@
},
{
"cell_type": "code",
"execution_count": 28,
"metadata": {},
"outputs": [],
"source": [
"# # 重新上传定性数据\n",
"\n",
"# def main(date='',token=None):\n",
"# updateExcelData(date,token)\n",
"# update_e_value('定性模型数据项12-11.xlsx', 8, 1000)\n",
"# x = qualitativeModel()\n",
"# print('**************************************************预测结果:',x)\n",
"# cur_time,cur_time2 = getNow(date)\n",
"# pushData(cur_time,x,token)\n",
"\n",
"\n",
"# start_date = datetime(2025, 1, 15)\n",
"# end_date = datetime(2025, 1, 24)\n",
"# token = getLogToken()\n",
"# while start_date < end_date:\n",
"# print(start_date.strftime('%Y%m%d'))\n",
"# main(start_date.strftime('%Y%m%d'),token)\n",
"# start_date += timedelta(days=1)\n",
"# time.sleep(5)\n",
" \n"
]
},
{
"cell_type": "code",
"execution_count": 29,
"execution_count": 7,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"更新数据前\n",
" 日期 京博指导价 70号沥青开工率 资金因素 昨日计划提货偏差 生产情况 基质沥青库存 下游客户价格预期 即期成本 \\\n",
"1326 2025-01-23 3650 6 6 NaN NaN NaN 3650 3846.3643 \n",
"\n",
" 订单结构 计划产量 京博产量 \n",
"1326 1 4505.365 NaN \n",
"日期存在,即将更新\n",
"新数据 [3650.0, '', '', '', '', '', 3650.0, 3846.3643, 1.0, 4505.365, '']\n",
"更新数据后\n",
" 日期 京博指导价 70号沥青开工率 资金因素 昨日计划提货偏差 生产情况 基质沥青库存 下游客户价格预期 \\\n",
"1326 2025-01-23 3650.0 3650.0 \n",
"\n",
" 即期成本 订单结构 计划产量 京博产量 \n",
"1326 3846.3643 1.0 4505.365 \n",
"更新完了\n"
"20250201\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"C:\\Users\\EDY\\AppData\\Local\\Temp\\ipykernel_12764\\1472055096.py:53: FutureWarning: DataFrame.applymap has been deprecated. Use DataFrame.map instead.\n",
" df = df.applymap(lambda x: float(x) if isinstance(x, (int, float)) else x)\n",
"C:\\Users\\EDY\\AppData\\Local\\Temp\\ipykernel_12764\\1472055096.py:57: FutureWarning: DataFrame.fillna with 'method' is deprecated and will raise in a future version. Use obj.ffill() or obj.bfill() instead.\n",
" df = df.fillna(method='ffill')\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"前一天的 3587.7887 <class 'float'>\n",
"现在的 3619.0713 <class 'float'>\n",
"昨日计划提货偏差改之前 162.28\n",
"昨日计划提货偏差改之后 520.4207999999999\n",
"**************************************************预测结果: 3651.07\n",
"20250202\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"C:\\Users\\EDY\\AppData\\Local\\Temp\\ipykernel_12764\\1472055096.py:53: FutureWarning: DataFrame.applymap has been deprecated. Use DataFrame.map instead.\n",
" df = df.applymap(lambda x: float(x) if isinstance(x, (int, float)) else x)\n",
"C:\\Users\\EDY\\AppData\\Local\\Temp\\ipykernel_12764\\1472055096.py:57: FutureWarning: DataFrame.fillna with 'method' is deprecated and will raise in a future version. Use obj.ffill() or obj.bfill() instead.\n",
" df = df.fillna(method='ffill')\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"前一天的 3619.0713 <class 'float'>\n",
"现在的 3624.724 <class 'float'>\n",
"昨日计划提货偏差改之前 162.28\n",
"昨日计划提货偏差改之后 -75.01419999999962\n",
"**************************************************预测结果: 3650.16\n",
"20250203\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"C:\\Users\\EDY\\AppData\\Local\\Temp\\ipykernel_12764\\1472055096.py:53: FutureWarning: DataFrame.applymap has been deprecated. Use DataFrame.map instead.\n",
" df = df.applymap(lambda x: float(x) if isinstance(x, (int, float)) else x)\n",
"C:\\Users\\EDY\\AppData\\Local\\Temp\\ipykernel_12764\\1472055096.py:57: FutureWarning: DataFrame.fillna with 'method' is deprecated and will raise in a future version. Use obj.ffill() or obj.bfill() instead.\n",
" df = df.fillna(method='ffill')\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"前一天的 3624.724 <class 'float'>\n",
"现在的 3698.7029 <class 'float'>\n",
"昨日计划提货偏差改之前 162.28\n",
"昨日计划提货偏差改之后 -68.52419999999984\n",
"**************************************************预测结果: 3650.17\n",
"20250204\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"C:\\Users\\EDY\\AppData\\Local\\Temp\\ipykernel_12764\\1472055096.py:53: FutureWarning: DataFrame.applymap has been deprecated. Use DataFrame.map instead.\n",
" df = df.applymap(lambda x: float(x) if isinstance(x, (int, float)) else x)\n",
"C:\\Users\\EDY\\AppData\\Local\\Temp\\ipykernel_12764\\1472055096.py:57: FutureWarning: DataFrame.fillna with 'method' is deprecated and will raise in a future version. Use obj.ffill() or obj.bfill() instead.\n",
" df = df.fillna(method='ffill')\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"前一天的 3698.7029 <class 'float'>\n",
"现在的 3671.4625 <class 'float'>\n",
"昨日计划提货偏差改之前 162.28\n",
"昨日计划提货偏差改之后 -117.01919999999973\n",
"**************************************************预测结果: 3650.11\n",
"20250205\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"C:\\Users\\EDY\\AppData\\Local\\Temp\\ipykernel_12764\\1472055096.py:53: FutureWarning: DataFrame.applymap has been deprecated. Use DataFrame.map instead.\n",
" df = df.applymap(lambda x: float(x) if isinstance(x, (int, float)) else x)\n",
"C:\\Users\\EDY\\AppData\\Local\\Temp\\ipykernel_12764\\1472055096.py:57: FutureWarning: DataFrame.fillna with 'method' is deprecated and will raise in a future version. Use obj.ffill() or obj.bfill() instead.\n",
" df = df.fillna(method='ffill')\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"前一天的 3671.4625 <class 'float'>\n",
"现在的 3622.508 <class 'float'>\n",
"昨日计划提货偏差改之前 -817.76\n",
"昨日计划提货偏差改之后 -81.05919999999969\n",
"**************************************************预测结果: 3650.15\n",
"20250206\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"C:\\Users\\EDY\\AppData\\Local\\Temp\\ipykernel_12764\\1472055096.py:53: FutureWarning: DataFrame.applymap has been deprecated. Use DataFrame.map instead.\n",
" df = df.applymap(lambda x: float(x) if isinstance(x, (int, float)) else x)\n",
"C:\\Users\\EDY\\AppData\\Local\\Temp\\ipykernel_12764\\1472055096.py:57: FutureWarning: DataFrame.fillna with 'method' is deprecated and will raise in a future version. Use obj.ffill() or obj.bfill() instead.\n",
" df = df.fillna(method='ffill')\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"前一天的 3622.508 <class 'float'>\n",
"现在的 3513.5033 <class 'float'>\n",
"昨日计划提货偏差改之前 578.78\n",
"昨日计划提货偏差改之后 -33.19920000000002\n",
"**************************************************预测结果: 3678.42\n",
"20250207\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"C:\\Users\\EDY\\AppData\\Local\\Temp\\ipykernel_12764\\1472055096.py:53: FutureWarning: DataFrame.applymap has been deprecated. Use DataFrame.map instead.\n",
" df = df.applymap(lambda x: float(x) if isinstance(x, (int, float)) else x)\n",
"C:\\Users\\EDY\\AppData\\Local\\Temp\\ipykernel_12764\\1472055096.py:57: FutureWarning: DataFrame.fillna with 'method' is deprecated and will raise in a future version. Use obj.ffill() or obj.bfill() instead.\n",
" df = df.fillna(method='ffill')\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"前一天的 3513.5033 <class 'float'>\n",
"现在的 3631.0462 <class 'float'>\n",
"昨日计划提货偏差改之前 1303\n",
"昨日计划提货偏差改之后 -53.10919999999987\n",
"**************************************************预测结果: 3773.7\n",
"20250208\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"C:\\Users\\EDY\\AppData\\Local\\Temp\\ipykernel_12764\\1472055096.py:53: FutureWarning: DataFrame.applymap has been deprecated. Use DataFrame.map instead.\n",
" df = df.applymap(lambda x: float(x) if isinstance(x, (int, float)) else x)\n",
"C:\\Users\\EDY\\AppData\\Local\\Temp\\ipykernel_12764\\1472055096.py:57: FutureWarning: DataFrame.fillna with 'method' is deprecated and will raise in a future version. Use obj.ffill() or obj.bfill() instead.\n",
" df = df.fillna(method='ffill')\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"前一天的 3631.0462 <class 'float'>\n",
"现在的 3664.8865 <class 'float'>\n",
"昨日计划提货偏差改之前 215.92\n",
"昨日计划提货偏差改之后 -71.42919999999958\n",
"**************************************************预测结果: 3750.17\n",
"20250209\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"C:\\Users\\EDY\\AppData\\Local\\Temp\\ipykernel_12764\\1472055096.py:53: FutureWarning: DataFrame.applymap has been deprecated. Use DataFrame.map instead.\n",
" df = df.applymap(lambda x: float(x) if isinstance(x, (int, float)) else x)\n",
"C:\\Users\\EDY\\AppData\\Local\\Temp\\ipykernel_12764\\1472055096.py:57: FutureWarning: DataFrame.fillna with 'method' is deprecated and will raise in a future version. Use obj.ffill() or obj.bfill() instead.\n",
" df = df.fillna(method='ffill')\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"前一天的 3664.8865 <class 'float'>\n",
"现在的 3680.6229 <class 'float'>\n",
"昨日计划提货偏差改之前 -337.98\n",
"昨日计划提货偏差改之后 -116.51919999999973\n",
"**************************************************预测结果: 3750.11\n",
"20250210\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"C:\\Users\\EDY\\AppData\\Local\\Temp\\ipykernel_12764\\1472055096.py:53: FutureWarning: DataFrame.applymap has been deprecated. Use DataFrame.map instead.\n",
" df = df.applymap(lambda x: float(x) if isinstance(x, (int, float)) else x)\n",
"C:\\Users\\EDY\\AppData\\Local\\Temp\\ipykernel_12764\\1472055096.py:57: FutureWarning: DataFrame.fillna with 'method' is deprecated and will raise in a future version. Use obj.ffill() or obj.bfill() instead.\n",
" df = df.fillna(method='ffill')\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"前一天的 3680.6229 <class 'float'>\n",
"现在的 3719.1501 <class 'float'>\n",
"昨日计划提货偏差改之前 1105.3\n",
"昨日计划提货偏差改之后 -118.21919999999955\n",
"**************************************************预测结果: 3750.11\n",
"20250211\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"C:\\Users\\EDY\\AppData\\Local\\Temp\\ipykernel_12764\\1472055096.py:53: FutureWarning: DataFrame.applymap has been deprecated. Use DataFrame.map instead.\n",
" df = df.applymap(lambda x: float(x) if isinstance(x, (int, float)) else x)\n",
"C:\\Users\\EDY\\AppData\\Local\\Temp\\ipykernel_12764\\1472055096.py:57: FutureWarning: DataFrame.fillna with 'method' is deprecated and will raise in a future version. Use obj.ffill() or obj.bfill() instead.\n",
" df = df.fillna(method='ffill')\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"前一天的 3719.1501 <class 'float'>\n",
"现在的 3806.0186 <class 'float'>\n",
"昨日计划提货偏差改之前 776.6\n",
"昨日计划提货偏差改之后 -111.46919999999955\n",
"**************************************************预测结果: 3750.12\n",
"20250212\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"C:\\Users\\EDY\\AppData\\Local\\Temp\\ipykernel_12764\\1472055096.py:53: FutureWarning: DataFrame.applymap has been deprecated. Use DataFrame.map instead.\n",
" df = df.applymap(lambda x: float(x) if isinstance(x, (int, float)) else x)\n",
"C:\\Users\\EDY\\AppData\\Local\\Temp\\ipykernel_12764\\1472055096.py:57: FutureWarning: DataFrame.fillna with 'method' is deprecated and will raise in a future version. Use obj.ffill() or obj.bfill() instead.\n",
" df = df.fillna(method='ffill')\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"前一天的 3806.0186 <class 'float'>\n",
"现在的 3870.8876 <class 'float'>\n",
"昨日计划提货偏差改之前 -543.94\n",
"昨日计划提货偏差改之后 -77.78920000000016\n",
"**************************************************预测结果: 3800.16\n",
"20250213\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"C:\\Users\\EDY\\AppData\\Local\\Temp\\ipykernel_12764\\1472055096.py:53: FutureWarning: DataFrame.applymap has been deprecated. Use DataFrame.map instead.\n",
" df = df.applymap(lambda x: float(x) if isinstance(x, (int, float)) else x)\n",
"C:\\Users\\EDY\\AppData\\Local\\Temp\\ipykernel_12764\\1472055096.py:57: FutureWarning: DataFrame.fillna with 'method' is deprecated and will raise in a future version. Use obj.ffill() or obj.bfill() instead.\n",
" df = df.fillna(method='ffill')\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"前一天的 3870.8876 <class 'float'>\n",
"现在的 3669.5691 <class 'float'>\n",
"昨日计划提货偏差改之前 319.6\n",
"昨日计划提货偏差改之后 9.210799999999836\n",
"**************************************************预测结果: 3760.01\n",
"20250214\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"C:\\Users\\EDY\\AppData\\Local\\Temp\\ipykernel_12764\\1472055096.py:53: FutureWarning: DataFrame.applymap has been deprecated. Use DataFrame.map instead.\n",
" df = df.applymap(lambda x: float(x) if isinstance(x, (int, float)) else x)\n",
"C:\\Users\\EDY\\AppData\\Local\\Temp\\ipykernel_12764\\1472055096.py:57: FutureWarning: DataFrame.fillna with 'method' is deprecated and will raise in a future version. Use obj.ffill() or obj.bfill() instead.\n",
" df = df.fillna(method='ffill')\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"前一天的 3669.5691 <class 'float'>\n",
"现在的 3727.5257 <class 'float'>\n",
"昨日计划提货偏差改之前 811.66\n",
"昨日计划提货偏差改之后 14.500800000000709\n",
"**************************************************预测结果: 3750.28\n",
"20250215\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"C:\\Users\\EDY\\AppData\\Local\\Temp\\ipykernel_12764\\1472055096.py:53: FutureWarning: DataFrame.applymap has been deprecated. Use DataFrame.map instead.\n",
" df = df.applymap(lambda x: float(x) if isinstance(x, (int, float)) else x)\n",
"C:\\Users\\EDY\\AppData\\Local\\Temp\\ipykernel_12764\\1472055096.py:57: FutureWarning: DataFrame.fillna with 'method' is deprecated and will raise in a future version. Use obj.ffill() or obj.bfill() instead.\n",
" df = df.fillna(method='ffill')\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"前一天的 3727.5257 <class 'float'>\n",
"现在的 3653.1038 <class 'float'>\n",
"昨日计划提货偏差改之前 3093.54\n",
"昨日计划提货偏差改之后 79.19080000000031\n",
"**************************************************预测结果: 3750.38\n",
"20250216\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"C:\\Users\\EDY\\AppData\\Local\\Temp\\ipykernel_12764\\1472055096.py:53: FutureWarning: DataFrame.applymap has been deprecated. Use DataFrame.map instead.\n",
" df = df.applymap(lambda x: float(x) if isinstance(x, (int, float)) else x)\n",
"C:\\Users\\EDY\\AppData\\Local\\Temp\\ipykernel_12764\\1472055096.py:57: FutureWarning: DataFrame.fillna with 'method' is deprecated and will raise in a future version. Use obj.ffill() or obj.bfill() instead.\n",
" df = df.fillna(method='ffill')\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"前一天的 3653.1038 <class 'float'>\n",
"现在的 3690.2938 <class 'float'>\n",
"昨日计划提货偏差改之前 448.52\n",
"昨日计划提货偏差改之后 -50.14919999999984\n",
"**************************************************预测结果: 3750.19\n",
"20250217\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"C:\\Users\\EDY\\AppData\\Local\\Temp\\ipykernel_12764\\1472055096.py:53: FutureWarning: DataFrame.applymap has been deprecated. Use DataFrame.map instead.\n",
" df = df.applymap(lambda x: float(x) if isinstance(x, (int, float)) else x)\n",
"C:\\Users\\EDY\\AppData\\Local\\Temp\\ipykernel_12764\\1472055096.py:57: FutureWarning: DataFrame.fillna with 'method' is deprecated and will raise in a future version. Use obj.ffill() or obj.bfill() instead.\n",
" df = df.fillna(method='ffill')\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"前一天的 3690.2938 <class 'float'>\n",
"现在的 3666.4264 <class 'float'>\n",
"昨日计划提货偏差改之前 -1512.9\n",
"昨日计划提货偏差改之后 -138.7491999999993\n",
"**************************************************预测结果: 3750.08\n",
"20250218\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"C:\\Users\\EDY\\AppData\\Local\\Temp\\ipykernel_12764\\1472055096.py:53: FutureWarning: DataFrame.applymap has been deprecated. Use DataFrame.map instead.\n",
" df = df.applymap(lambda x: float(x) if isinstance(x, (int, float)) else x)\n",
"C:\\Users\\EDY\\AppData\\Local\\Temp\\ipykernel_12764\\1472055096.py:57: FutureWarning: DataFrame.fillna with 'method' is deprecated and will raise in a future version. Use obj.ffill() or obj.bfill() instead.\n",
" df = df.fillna(method='ffill')\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"前一天的 3666.4264 <class 'float'>\n",
"现在的 3710.5143 <class 'float'>\n",
"昨日计划提货偏差改之前 1736.44\n",
"昨日计划提货偏差改之后 -120.28920000000016\n",
"**************************************************预测结果: 3800.53\n",
"20250219\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"C:\\Users\\EDY\\AppData\\Local\\Temp\\ipykernel_12764\\1472055096.py:53: FutureWarning: DataFrame.applymap has been deprecated. Use DataFrame.map instead.\n",
" df = df.applymap(lambda x: float(x) if isinstance(x, (int, float)) else x)\n",
"C:\\Users\\EDY\\AppData\\Local\\Temp\\ipykernel_12764\\1472055096.py:57: FutureWarning: DataFrame.fillna with 'method' is deprecated and will raise in a future version. Use obj.ffill() or obj.bfill() instead.\n",
" df = df.fillna(method='ffill')\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"前一天的 3710.5143 <class 'float'>\n",
"现在的 3786.9784 <class 'float'>\n",
"昨日计划提货偏差改之前 449.02\n",
"昨日计划提货偏差改之后 -205.32920000000013\n",
"**************************************************预测结果: 3800.41\n",
"20250220\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"C:\\Users\\EDY\\AppData\\Local\\Temp\\ipykernel_12764\\1472055096.py:53: FutureWarning: DataFrame.applymap has been deprecated. Use DataFrame.map instead.\n",
" df = df.applymap(lambda x: float(x) if isinstance(x, (int, float)) else x)\n",
"C:\\Users\\EDY\\AppData\\Local\\Temp\\ipykernel_12764\\1472055096.py:57: FutureWarning: DataFrame.fillna with 'method' is deprecated and will raise in a future version. Use obj.ffill() or obj.bfill() instead.\n",
" df = df.fillna(method='ffill')\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"前一天的 3786.9784 <class 'float'>\n",
"现在的 3766.1403 <class 'float'>\n",
"昨日计划提货偏差改之前 1284.6\n",
"昨日计划提货偏差改之后 -186.1891999999998\n",
"**************************************************预测结果: 3830.46\n",
"20250221\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"C:\\Users\\EDY\\AppData\\Local\\Temp\\ipykernel_12764\\1472055096.py:53: FutureWarning: DataFrame.applymap has been deprecated. Use DataFrame.map instead.\n",
" df = df.applymap(lambda x: float(x) if isinstance(x, (int, float)) else x)\n",
"C:\\Users\\EDY\\AppData\\Local\\Temp\\ipykernel_12764\\1472055096.py:57: FutureWarning: DataFrame.fillna with 'method' is deprecated and will raise in a future version. Use obj.ffill() or obj.bfill() instead.\n",
" df = df.fillna(method='ffill')\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"前一天的 3766.1403 <class 'float'>\n",
"现在的 3747.6395 <class 'float'>\n",
"昨日计划提货偏差改之前 2301.56\n",
"昨日计划提货偏差改之后 -186.66919999999936\n",
"**************************************************预测结果: 3850.48\n",
"20250222\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"C:\\Users\\EDY\\AppData\\Local\\Temp\\ipykernel_12764\\1472055096.py:53: FutureWarning: DataFrame.applymap has been deprecated. Use DataFrame.map instead.\n",
" df = df.applymap(lambda x: float(x) if isinstance(x, (int, float)) else x)\n",
"C:\\Users\\EDY\\AppData\\Local\\Temp\\ipykernel_12764\\1472055096.py:57: FutureWarning: DataFrame.fillna with 'method' is deprecated and will raise in a future version. Use obj.ffill() or obj.bfill() instead.\n",
" df = df.fillna(method='ffill')\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"前一天的 3747.6395 <class 'float'>\n",
"现在的 3564.5329 <class 'float'>\n",
"昨日计划提货偏差改之前 3639.18\n",
"昨日计划提货偏差改之后 -204.83919999999944\n",
"**************************************************预测结果: 3813.85\n",
"20250223\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"C:\\Users\\EDY\\AppData\\Local\\Temp\\ipykernel_12764\\1472055096.py:53: FutureWarning: DataFrame.applymap has been deprecated. Use DataFrame.map instead.\n",
" df = df.applymap(lambda x: float(x) if isinstance(x, (int, float)) else x)\n",
"C:\\Users\\EDY\\AppData\\Local\\Temp\\ipykernel_12764\\1472055096.py:57: FutureWarning: DataFrame.fillna with 'method' is deprecated and will raise in a future version. Use obj.ffill() or obj.bfill() instead.\n",
" df = df.fillna(method='ffill')\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"前一天的 3564.5329 <class 'float'>\n",
"现在的 3585.6018 <class 'float'>\n",
"昨日计划提货偏差改之前 2779.86\n",
"昨日计划提货偏差改之后 -191.76919999999973\n",
"**************************************************预测结果: 3850.49\n",
"20250224\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"C:\\Users\\EDY\\AppData\\Local\\Temp\\ipykernel_12764\\1472055096.py:53: FutureWarning: DataFrame.applymap has been deprecated. Use DataFrame.map instead.\n",
" df = df.applymap(lambda x: float(x) if isinstance(x, (int, float)) else x)\n",
"C:\\Users\\EDY\\AppData\\Local\\Temp\\ipykernel_12764\\1472055096.py:57: FutureWarning: DataFrame.fillna with 'method' is deprecated and will raise in a future version. Use obj.ffill() or obj.bfill() instead.\n",
" df = df.fillna(method='ffill')\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"前一天的 3585.6018 <class 'float'>\n",
"现在的 3668.5404 <class 'float'>\n",
"昨日计划提货偏差改之前 787.18\n",
"昨日计划提货偏差改之后 -169.46919999999955\n",
"**************************************************预测结果: 3850.04\n",
"20250225\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"C:\\Users\\EDY\\AppData\\Local\\Temp\\ipykernel_12764\\1472055096.py:53: FutureWarning: DataFrame.applymap has been deprecated. Use DataFrame.map instead.\n",
" df = df.applymap(lambda x: float(x) if isinstance(x, (int, float)) else x)\n",
"C:\\Users\\EDY\\AppData\\Local\\Temp\\ipykernel_12764\\1472055096.py:57: FutureWarning: DataFrame.fillna with 'method' is deprecated and will raise in a future version. Use obj.ffill() or obj.bfill() instead.\n",
" df = df.fillna(method='ffill')\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"前一天的 3668.5404 <class 'float'>\n",
"现在的 3791.3805 <class 'float'>\n",
"昨日计划提货偏差改之前 -2220.81\n",
"昨日计划提货偏差改之后 284.0117\n",
"**************************************************预测结果: 3825.27\n",
"20250226\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"C:\\Users\\EDY\\AppData\\Local\\Temp\\ipykernel_12764\\1472055096.py:53: FutureWarning: DataFrame.applymap has been deprecated. Use DataFrame.map instead.\n",
" df = df.applymap(lambda x: float(x) if isinstance(x, (int, float)) else x)\n",
"C:\\Users\\EDY\\AppData\\Local\\Temp\\ipykernel_12764\\1472055096.py:57: FutureWarning: DataFrame.fillna with 'method' is deprecated and will raise in a future version. Use obj.ffill() or obj.bfill() instead.\n",
" df = df.fillna(method='ffill')\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"前一天的 3791.3805 <class 'float'>\n",
"现在的 3553.9243 <class 'float'>\n",
"昨日计划提货偏差改之前 1969.52\n",
"昨日计划提货偏差改之后 347.3217000000004\n",
"**************************************************预测结果: 3753.31\n",
"20250227\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"C:\\Users\\EDY\\AppData\\Local\\Temp\\ipykernel_12764\\1472055096.py:53: FutureWarning: DataFrame.applymap has been deprecated. Use DataFrame.map instead.\n",
" df = df.applymap(lambda x: float(x) if isinstance(x, (int, float)) else x)\n",
"C:\\Users\\EDY\\AppData\\Local\\Temp\\ipykernel_12764\\1472055096.py:57: FutureWarning: DataFrame.fillna with 'method' is deprecated and will raise in a future version. Use obj.ffill() or obj.bfill() instead.\n",
" df = df.fillna(method='ffill')\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"前一天的 3553.9243 <class 'float'>\n",
"现在的 3576.4854 <class 'float'>\n",
"昨日计划提货偏差改之前 4503.35\n",
"昨日计划提货偏差改之后 302.53169999999955\n",
"**************************************************预测结果: 3800.73\n",
"20250228\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"C:\\Users\\EDY\\AppData\\Local\\Temp\\ipykernel_12764\\1472055096.py:53: FutureWarning: DataFrame.applymap has been deprecated. Use DataFrame.map instead.\n",
" df = df.applymap(lambda x: float(x) if isinstance(x, (int, float)) else x)\n",
"C:\\Users\\EDY\\AppData\\Local\\Temp\\ipykernel_12764\\1472055096.py:57: FutureWarning: DataFrame.fillna with 'method' is deprecated and will raise in a future version. Use obj.ffill() or obj.bfill() instead.\n",
" df = df.fillna(method='ffill')\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"前一天的 3576.4854 <class 'float'>\n",
"现在的 3645.4569 <class 'float'>\n",
"昨日计划提货偏差改之前 4517.04\n",
"昨日计划提货偏差改之后 -363.1983\n",
"**************************************************预测结果: 3799.79\n",
"20250301\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"C:\\Users\\EDY\\AppData\\Local\\Temp\\ipykernel_12764\\1472055096.py:53: FutureWarning: DataFrame.applymap has been deprecated. Use DataFrame.map instead.\n",
" df = df.applymap(lambda x: float(x) if isinstance(x, (int, float)) else x)\n",
"C:\\Users\\EDY\\AppData\\Local\\Temp\\ipykernel_12764\\1472055096.py:57: FutureWarning: DataFrame.fillna with 'method' is deprecated and will raise in a future version. Use obj.ffill() or obj.bfill() instead.\n",
" df = df.fillna(method='ffill')\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"前一天的 3645.4569 <class 'float'>\n",
"现在的 3615.0332 <class 'float'>\n",
"昨日计划提货偏差改之前 993.87\n",
"昨日计划提货偏差改之后 1276.8767999999995\n",
"**************************************************预测结果: 3802.24\n",
"20250302\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"C:\\Users\\EDY\\AppData\\Local\\Temp\\ipykernel_12764\\1472055096.py:53: FutureWarning: DataFrame.applymap has been deprecated. Use DataFrame.map instead.\n",
" df = df.applymap(lambda x: float(x) if isinstance(x, (int, float)) else x)\n",
"C:\\Users\\EDY\\AppData\\Local\\Temp\\ipykernel_12764\\1472055096.py:57: FutureWarning: DataFrame.fillna with 'method' is deprecated and will raise in a future version. Use obj.ffill() or obj.bfill() instead.\n",
" df = df.fillna(method='ffill')\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"前一天的 3615.0332 <class 'float'>\n",
"现在的 3615.0995 <class 'float'>\n",
"昨日计划提货偏差改之前 1499.46\n",
"昨日计划提货偏差改之后 663.4968000000003\n",
"**************************************************预测结果: 3801.29\n",
"20250303\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"C:\\Users\\EDY\\AppData\\Local\\Temp\\ipykernel_12764\\1472055096.py:53: FutureWarning: DataFrame.applymap has been deprecated. Use DataFrame.map instead.\n",
" df = df.applymap(lambda x: float(x) if isinstance(x, (int, float)) else x)\n",
"C:\\Users\\EDY\\AppData\\Local\\Temp\\ipykernel_12764\\1472055096.py:57: FutureWarning: DataFrame.fillna with 'method' is deprecated and will raise in a future version. Use obj.ffill() or obj.bfill() instead.\n",
" df = df.fillna(method='ffill')\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"前一天的 3615.0995 <class 'float'>\n",
"现在的 3657.0767 <class 'float'>\n",
"昨日计划提货偏差改之前 1499.46\n",
"昨日计划提货偏差改之后 663.4968000000003\n",
"**************************************************预测结果: 3801.29\n"
]
}
],
"source": [
"# 调试更新数据\n",
"date = '2025-01-24'\n",
"# 重新上传定性数据\n",
"\n",
"def main(date='',token=None):\n",
" updateExcelData(date,token)\n",
" update_e_value('定性模型数据项12-11.xlsx', 8, 1000)\n",
" x = qualitativeModel()\n",
" print('**************************************************预测结果:',x)\n",
" cur_time,cur_time2 = getNow(date)\n",
" pushData(cur_time,x,token)\n",
"\n",
"\n",
"start_date = datetime(2025, 2, 1)\n",
"end_date = datetime(2025, 3, 4)\n",
"token = getLogToken()\n",
"updateYesterdayExcelData(date=date,token=token)\n",
"print('更新完了')"
"while start_date < end_date:\n",
" print(start_date.strftime('%Y%m%d'))\n",
" main(start_date.strftime('%Y%m%d'),token)\n",
" start_date += timedelta(days=1)\n",
" time.sleep(5)\n",
" \n"
]
},
{
"cell_type": "code",
"execution_count": 30,
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
"# # 调试更新数据\n",
"# date = '2025-01-24'\n",
"# token = getLogToken()\n",
"# updateYesterdayExcelData(date=date,token=token)\n",
"# print('更新完了')"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [],
"source": [

View File

@ -2,9 +2,17 @@
"cells": [
{
"cell_type": "code",
"execution_count": 5,
"execution_count": null,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"WARNING:tensorflow:From C:\\Users\\EDY\\AppData\\Roaming\\Python\\Python311\\site-packages\\keras\\src\\losses.py:2976: The name tf.losses.sparse_softmax_cross_entropy is deprecated. Please use tf.compat.v1.losses.sparse_softmax_cross_entropy instead.\n",
"\n"
]
},
{
"data": {
"text/html": [
@ -548,16 +556,16 @@
" # write_xls(data_list)\n",
"\n",
"\n",
"def start_3(date):\n",
"def start_3(date,token,token_push):\n",
" '''预测上传数据'''\n",
" read_xls_data()\n",
"\n",
" token = get_head_auth()\n",
" if not token:\n",
" return\n",
" token_push = get_head_push_auth()\n",
" if not token_push:\n",
" return\n",
" # token = get_head_auth()\n",
" # if not token:\n",
" # return\n",
" # token_push = get_head_push_auth()\n",
" # if not token_push:\n",
" # return\n",
"\n",
" datas = get_data_value(token, one_cols[1:],date)\n",
" if not datas:\n",
@ -579,8 +587,8 @@
" else:\n",
" append_rows.append(\"\")\n",
" save_xls(append_rows)\n",
" # optimize_Model()\n",
" # upload_data_to_system(token_push,date)\n",
" optimize_Model()\n",
" upload_data_to_system(token_push,date)\n",
" # data_list.append(three_cols)\n",
" # write_xls(data_list)\n",
"\n",
@ -621,13 +629,13 @@
" # write_xls(data_list)\n",
"\n",
"\n",
"def start_2(date):\n",
"def start_2(date,token):\n",
" '''更新数据'''\n",
" read_xls_data()\n",
"\n",
" token = get_head_auth()\n",
" if not token:\n",
" return\n",
" # token = get_head_auth()\n",
" # if not token:\n",
" # return\n",
" \n",
"\n",
" datas = get_data_value(token, one_cols[1:],date)\n",
@ -788,43 +796,138 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": null,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"20241231\n"
"20250102\n",
"新增数据: ['2025-01-02', 8057.0, 6784.0, 0.05, 0.0, 3650.0, 0.75, 0.0, 0.0, 3520.0, 7.9, 0.2, 0.2, 3540.0, 1.15, '', 3600.0, 73.36, '', '', 3669.0, 25.1642, '', '', '', '', 229522.1, 6197.58, 3551.9952, '', '', 75999.0902808, 6931.295, '']\n",
"20250103\n",
"新增数据: ['2025-01-03', 8121.0, 6829.0, 0.05, 0.0, 3650.0, 0.7, 0.0, 0.0, 3520.0, 7.9, 0.2, 0.2, 3540.0, 1.15, '', 3600.0, 73.36, 76.03, '', 3678.0, 29.9291, '', '', '', '', 229522.1, 8038.22, 897.5595, '', 50180.0, 73015.8650188, 6693.26, 3602.01]\n",
"20250104\n",
"新增数据: ['2025-01-04', 8156.0, 6856.0, 0.05, 0.0, 3650.0, 0.7, 0.0, 0.0, 3520.0, 7.9, 0.2, 0.2, 3540.0, 1.15, '', 3600.0, 73.36, 76.69, '', '', 32.2931, '', '', '', '', 229522.1, 7900.62, 3667.3859, '', '', 72148.9646528, 6804.94, '']\n",
"20250105\n",
"新增数据: ['2025-01-05', 8192.0, 6856.0, 0.05, 0.0, 3650.0, 0.65, 0.0, 0.0, 3520.0, 7.9, 0.15, 0.2, 3540.0, 1.2, '', 3600.0, 76.69, '', '', '', 30.8747, '', '', '', '', 229522.1, 6417.5, 3657.2132, '', '', 75308.7978357, 6814.96, '']\n",
"20250106\n",
"新增数据: ['2025-01-06', 8226.0, 6856.0, 0.05, 0.0, 3650.0, 0.6, 0.0, 0.0, 3500.0, 7.9, 0.12, 0.2, 3510.0, 1.28, '', 3600.0, 76.69, '', '', 3610.0, 31.8203, '', '', '', '', 229522.1, 5489.2, 3679.4214, '', '', 74486.3079283, 6814.99, '']\n",
"20250107\n",
"新增数据: ['2025-01-07', 8226.0, 6904.0, 0.03, 0.0, 3600.0, 0.57, 0.0, 0.0, 3480.0, 7.9, 0.3, 0.2, 3510.0, 1.26, '', 3550.0, 76.69, 76.26, '', 3603.0, 33.0024, '', '', '', 12.82003192, 229522.1, 5358.32, 3634.1004, '', '', 76588.1941448, 6795.11, '']\n",
"20250108\n",
"新增数据: ['2025-01-08', 8318.0, 6939.0, 0.03, 0.25, 3600.0, 0.57, 0.0, 0.0, 3480.0, 7.9, 0.3, 0.2, 3470.0, 1.16, '', 3530.0, 76.69, 77.25, '', 3615.0, 34.5154, '', '', '', '', 229522.1, 6866.76, 3720.2633, '', '', 75902.1162471, 6756.81, '']\n",
"20250109\n",
"新增数据: ['2025-01-09', 8363.0, 6984.0, 0.03, 0.25, 3600.0, 0.79, 0.0, 0.0, 3480.0, 7.9, 0.2, 0.2, 3470.0, 1.06, '', 3530.0, 76.69, 76.2, '', 3649.0, 31.6785, '', '', '', '', 229522.1, 8478.06, 3571.7593, '', '', 73757.9160547, 6772.99, '']\n",
"20250110\n",
"新增数据: ['2025-01-10', 8467.0, 7031.0, 0.03, 0.25, 3600.0, 1.0, 0.0, 0.0, 3500.0, 7.9, 0.2, 0.2, 3490.0, 1.06, '', 3530.0, 76.69, 77.21, '', 3691.0, 34.5154, '', '', '', '', 229522.1, 6857.04, 3750.5711, '', '', 73779.8843598, 6569.2, '']\n",
"20250111\n",
"新增数据: ['2025-01-11', 9050.0, 7567.0, '', '', '', '', '', '', '', '', '', '', '', '', '', 3700.0, 76.69, 79.59, '', '', 34.5154, '', '', '', '', 229522.1, 8679.56, 3907.1448, '', 140.0, 72204.2847252, 6466.43, 3900.0]\n",
"20250112\n",
"新增数据: ['2025-01-12', 9323.0, 7675.0, 0.15, 0.25, 3600.0, 1.22, 0.0, 0.0, 3630.0, 7.9, 0.1, 0.2, 3650.0, 1.26, '', 3700.0, 79.59, '', '', '', 32.6241, '', '', '', '', 229522.1, 2818.9, 3687.137, '', '', 76933.4067215, 6479.1, '']\n",
"20250113\n",
"新增数据: ['2025-01-13', 9323.0, 7675.0, 0.15, 0.25, 3600.0, 1.32, 0.0, 0.0, 3630.0, 7.9, 0.1, 0.2, 3650.0, 1.36, '', 3800.0, 79.59, '', '', 3807.0, 34.9882, '', '', '', '', 229522.1, 2971.16, 3777.5616, '', 210.0, 79773.9416121, 5746.0, 3800.0]\n",
"20250114\n",
"新增数据: ['2025-01-14', 9047.0, 7454.0, 0.15, 0.25, 3600.0, 1.42, 0.0, 0.0, 3620.0, 7.9, 0.15, 0.2, 3620.0, 1.46, '', 3800.0, 79.59, 80.86, '', 3748.0, 34.9882, '', '', '', 12.95294256, 229522.1, 6394.5, 3781.754, '', '', 79492.6684067, 5645.07, '']\n",
"20250115\n",
"新增数据: ['2025-01-15', 8965.0, 7308.0, 0.15, 0.25, 3600.0, 1.52, 0.0, 0.0, 3620.0, 7.9, 0.15, 0.2, 3610.0, 1.51, '', 3700.0, 79.59, 80.01, '', 3795.0, 36.4066, '', '', '', '', 229522.1, 6365.01, 512.6357, '', '', 79167.4859979, 5680.14, '']\n",
"20250116\n",
"新增数据: ['2025-01-16', 8893.0, 7256.0, 0.15, 0.25, 3600.0, 1.62, 0.0, 0.0, 3620.0, 7.9, 0.2, 0.2, 3610.0, 1.51, '', 3700.0, 79.59, 82.43, '', 3847.0, 36.4066, '', '', '', '', 229522.1, 6617.55, 4137.6414, '', '', 78477.747561, 5353.39, '']\n",
"20250117\n",
"新增数据: ['2025-01-17', 8893.0, 7221.0, 0.45, 0.25, 3600.0, 1.32, 0.0, 0.0, 3600.0, 7.9, 0.2, 0.2, 3610.0, 1.51, '', 3700.0, 79.59, 81.36, '', 3795.0, 36.4066, '', '', '', '', 229522.1, 5119.64, 4008.3951, '', '', 79603.2505459, 4637.39, '']\n",
"20250118\n",
"新增数据: ['2025-01-18', 8848.0, 7175.0, 0.2, 0.0, 3600.0, 1.12, 0.0, 0.0, 3600.0, 7.9, 0.1, 0.2, 3610.0, 1.61, '', 3700.0, 79.59, 80.75, '', '', 32.6241, '', '', '', '', 229522.1, 2455.2, 3946.2519, '', '', 81923.5310154, 4563.86, '']\n",
"20250119\n",
"新增数据: ['2025-01-19', 8766.0, 7093.0, 0.2, 0.0, 3600.0, 1.12, 0.0, 0.0, 3600.0, 7.9, 0.1, 0.2, 3610.0, 1.51, '', 3700.0, 80.75, '', '', '', 31.2057, '', '', '', '', 229522.1, 1344.66, 3972.0295, '', '', 85334.9336625, 4614.82, '']\n",
"20250120\n",
"新增数据: ['2025-01-20', 8665.0, 7013.0, 0.2, 0.0, 3600.0, 1.12, 0.0, 0.0, 3600.0, 7.9, 0.1, 0.2, 3610.0, 1.61, '', 3700.0, 80.75, '', '', 3735.0, 31.2057, '', '', '', '', 229522.1, 1914.2, 4009.7693, '', '', 88766.602507, 4651.54, '']\n",
"20250121\n",
"新增数据: ['2025-01-21', 8665.0, 6957.0, 0.2, 0.0, 3600.0, 0.92, 0.0, 0.0, 3600.0, 7.9, 0.1, 0.2, 3610.0, 1.71, '', 3650.0, 80.75, 76.33, '', 3736.0, 30.7329, '', '', '', 13.92264145, 229522.1, 2044.82, 3942.8707, '', '', 91204.3689572, 4639.75, '']\n",
"20250122\n",
"新增数据: ['2025-01-22', 8665.0, 6957.0, 0.2, 0.0, 3600.0, 0.72, 0.0, 0.0, 3600.0, 7.9, 0.1, 0.2, 3610.0, 1.81, '', 3650.0, 80.75, 79.4, '', 3749.0, 30.7329, '', '', '', '', 229522.1, 3259.22, 3871.276, '', '', 93526.1525172, 4624.36, '']\n",
"20250123\n",
"新增数据: ['2025-01-23', 8630.0, 6913.0, 0.35, 0.0, 3600.0, 0.32, 0.0, 0.0, 3600.0, 7.9, 0.1, 0.2, 3610.0, 1.91, '', 3650.0, 80.75, 76.59, '', 3739.0, 29.7872, '', '', '', '', 229522.1, 2853.49, 3846.3643, '', '', 95756.3698162, 4650.31, '']\n",
"20250124\n",
"新增数据: ['2025-01-24', 8630.0, 6913.0, 0.3, 0.0, 3600.0, 0.0, 0.0, 0.0, 3600.0, 7.9, 0.1, 0.2, 3610.0, 2.01, '', 3650.0, 80.75, 77.43, '', 3750.0, 29.7872, '', '', '', '', 229522.1, 437.72, 3816.5609, '', '', 100306.8638258, 4617.64, 3650.0]\n",
"20250125\n",
"新增数据: ['2025-01-25', 8804.0, 6913.0, 0.0, 0.0, 3600.0, 0.0, 0.0, 0.0, 3600.0, 7.9, 0.03, 0.2, 3610.0, 2.18, '', 3650.0, 80.75, 74.88, '', '', 28.3688, '', '', '', '', 229522.1, '', 3705.6961, '', '', 105207.7537524, 4618.44, '']\n",
"20250126\n",
"新增数据: ['2025-01-26', 8857.0, 6939.0, 0.0, 0.0, 3600.0, 0.0, 0.0, 0.0, 3600.0, 7.9, 0.03, 0.2, 3610.0, 2.35, '', 3650.0, 74.88, '', '', '', 28.3688, '', '', '', '', 229522.1, '', 3694.4462, '', '', 110382.4647653, 4565.66, '']\n",
"20250127\n",
"新增数据: ['2025-01-27', 8857.0, 6939.0, 0.0, 0.0, 3600.0, 0.0, 0.0, 0.0, 3600.0, 7.9, 0.0, 0.2, 3610.0, 2.55, '', 3650.0, 74.88, '', '', 3715.0, 28.3688, '', '', '', '', 229522.1, '', 3626.8247, '', '', 115505.5177864, 4535.31, '']\n",
"20250128\n",
"新增数据: ['2025-01-28', 8857.0, 6939.0, 0.0, 0.0, 3600.0, 0.0, 0.0, 0.0, 3600.0, 7.9, 0.0, 0.2, 3610.0, 2.75, '', 3650.0, 74.88, 73.65, '', '', 27.896, '', '', '', 15.05736163, 229522.1, '', 3584.3414, '', '', 120715.6507229, 4561.74, '']\n",
"20250129\n",
"新增数据: ['2025-01-29', 8857.0, 6939.0, 0.0, 0.0, 3600.0, 0.0, 0.0, 0.0, 3600.0, 7.9, 0.0, 0.2, 3610.0, 2.95, '', 3650.0, 74.88, 76.53, '', '', 26.9504, '', '', '', '', 229522.1, '', 3618.8126, '', '', 125785.4515644, 4593.562, '']\n",
"20250130\n",
"新增数据: ['2025-01-30', 8857.0, 6939.0, '', '', '', '', '', '', '', '', '', '', '', '', '', 3650.0, 74.88, 75.89, '', '', 26.0047, '', '', '', '', 229522.1, '', 3585.9993, '', '', 130781.5671614, 4620.688, '']\n",
"20250131\n",
"新增数据: ['2025-01-31', 8857.0, 6939.0, '', '', '', '', '', '', '', '', '', '', '', '', '', 3650.0, 74.88, 76.15, '', '', 25.5319, 68.6, 225.29, '', '', 229522.1, '', 3587.7887, '', '', 134131.216744, 4025.178, '']\n",
"20250201\n",
"新增数据: ['2025-02-01', 8857.0, 6904.0, '', '', '', '', '', '', '', '', '', '', '', '', '', 3650.0, 74.88, 76.48, '', '', 25.5319, '', '', '', '', 229522.1, '', 3619.0713, '', '', 141390.8400342, 5245.69, '']\n",
"20250202\n",
"新增数据: ['2025-02-02', 8857.0, 6883.0, '', '', '', '', '', '', '', '', '', '', '', '', '', 3650.0, 76.48, '', '', '', 25.5319, '', '', '', '', 229522.1, '', 3624.724, '', '', 146444.993536, 4650.255, '']\n",
"20250203\n",
"新增数据: ['2025-02-03', 8857.0, 6883.0, '', '', '', '', '', '', '', '', '', '', '', '', '', 3650.0, 76.48, '', '', '', 25.5319, '', '', '', '', 229522.1, '', 3698.7029, '', '', 151802.9709409, 4656.745, '']\n",
"20250204\n",
"新增数据: ['2025-02-04', 8905.0, 6948.0, 0.0, 0.0, 3600.0, 0.0, 0.0, 0.0, 3600.0, 7.9, 0.0, 0.2, 3610.0, 4.0, '', 3650.0, 76.48, 75.4, '', '', 26.4775, '', '', '', 17.21173912, 229522.1, 32.7, 3671.4625, '', '', 156872.340789, 4608.25, '']\n",
"20250205\n",
"新增数据: ['2025-02-05', 8956.0, 7022.0, 0.0, 0.25, 3600.0, 0.5, 0.0, 0.0, 3600.0, 7.9, 0.0, 0.2, 3610.0, 4.0, '', 3700.0, 76.48, 76.06, '', 3797.0, 27.4232, '', '', '', '', 229522.1, 857.76, 3622.508, '', '', 160664.5999171, 4644.21, '']\n",
"20250206\n",
"新增数据: ['2025-02-06', 8956.0, 7066.0, 0.0, 0.25, 3600.0, 0.75, 0.0, 0.0, 3600.0, 7.9, 0.0, 0.2, 3610.0, 4.2, '', 3750.0, 76.48, 74.68, '', 3779.0, 27.7541, '', '', '', '', 229522.1, 1217.12, 3513.5033, '', '', 164388.6227375, 4692.07, '']\n",
"20250207\n",
"新增数据: ['2025-02-07', 8921.0, 7031.0, 0.1, 0.25, 3650.0, 0.8, 0.0, 0.0, 3600.0, 7.9, 0.0, 0.2, 3610.0, 4.4, '', 3750.0, 76.48, 74.23, '', 3812.0, 27.7541, '', '', '', '', 229522.1, 942.0, 3631.0462, '', '', 168393.8166163, 4672.16, '']\n",
"20250208\n",
"新增数据: ['2025-02-08', 8866.0, 7004.0, 0.15, 0.25, 3650.0, 0.8, 0.0, 0.0, 3650.0, 7.9, 0.0, 0.2, 3900.0, 4.6, '', 3750.0, 76.48, 74.64, '', '', 27.7541, '', '', '', '', 229522.1, 1089.08, 3664.8865, '', 1000.0, 172610.1660848, 4653.84, 4300.0]\n",
"20250209\n",
"新增数据: ['2025-02-09', 8875.0, 7013.0, '', '', '', '', '', '', '', '', '', '', '', '', '', 3750.0, 74.64, '', '', '', 27.7541, '', '', '', '', 229522.1, 1952.98, 3680.6229, '', '', 175400.4021806, 4608.75, '']\n",
"20250210\n",
"新增数据: ['2025-02-10', 8875.0, 7013.0, 0.15, 0.25, 3650.0, 0.9, 0.0, 0.0, 3650.0, 7.9, 0.0, 0.2, 3900.0, 4.8, '', 3750.0, 74.64, '', '', 3778.0, 28.608, '', '', '', '', 229522.1, 2114.7, 3719.1501, '', 2000.0, 177876.7630674, 4607.05, 4350.0]\n",
"20250211\n",
"新增数据: ['2025-02-11', 8875.0, 7031.0, 0.15, 0.25, 3650.0, 1.0, 0.0, 0.0, 3650.0, 7.9, 0.0, 0.2, 3900.0, 4.8, '', 3800.0, 74.64, 76.01, '', 3776.0, 26.9001, '', '', '', 18.76416033, 229522.1, 1951.18, 3806.0186, '', '', 180448.1199647, 4613.8, '']\n",
"20250212\n"
]
},
{
"ename": "PermissionError",
"evalue": "[Errno 13] Permission denied: '沥青数据项.xls'",
"ename": "KeyboardInterrupt",
"evalue": "",
"output_type": "error",
"traceback": [
"\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[1;31mPermissionError\u001b[0m Traceback (most recent call last)",
"Cell \u001b[1;32mIn[6], line 8\u001b[0m\n\u001b[0;32m 6\u001b[0m \u001b[38;5;28;01mwhile\u001b[39;00m start_date \u001b[38;5;241m<\u001b[39m end_date:\n\u001b[0;32m 7\u001b[0m \u001b[38;5;28mprint\u001b[39m(start_date\u001b[38;5;241m.\u001b[39mstrftime(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m%\u001b[39m\u001b[38;5;124mY\u001b[39m\u001b[38;5;124m%\u001b[39m\u001b[38;5;124mm\u001b[39m\u001b[38;5;132;01m%d\u001b[39;00m\u001b[38;5;124m'\u001b[39m))\n\u001b[1;32m----> 8\u001b[0m start_3(start_date)\n\u001b[0;32m 9\u001b[0m time\u001b[38;5;241m.\u001b[39msleep(\u001b[38;5;241m1\u001b[39m)\n\u001b[0;32m 10\u001b[0m start_2(start_date)\n",
"Cell \u001b[1;32mIn[5], line 548\u001b[0m, in \u001b[0;36mstart_3\u001b[1;34m(date)\u001b[0m\n\u001b[0;32m 546\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[0;32m 547\u001b[0m append_rows\u001b[38;5;241m.\u001b[39mappend(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[1;32m--> 548\u001b[0m save_xls(append_rows)\n",
"Cell \u001b[1;32mIn[5], line 723\u001b[0m, in \u001b[0;36msave_xls\u001b[1;34m(append_rows)\u001b[0m\n\u001b[0;32m 720\u001b[0m new_sheet\u001b[38;5;241m.\u001b[39mwrite(row_count, col, append_rows[col])\n\u001b[0;32m 722\u001b[0m \u001b[38;5;66;03m# 保存新的xls文件\u001b[39;00m\n\u001b[1;32m--> 723\u001b[0m new_workbook\u001b[38;5;241m.\u001b[39msave(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m沥青数据项.xls\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n",
"File \u001b[1;32m~\\AppData\\Roaming\\Python\\Python311\\site-packages\\xlwt\\Workbook.py:710\u001b[0m, in \u001b[0;36mWorkbook.save\u001b[1;34m(self, filename_or_stream)\u001b[0m\n\u001b[0;32m 707\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01m.\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m CompoundDoc\n\u001b[0;32m 709\u001b[0m doc \u001b[38;5;241m=\u001b[39m CompoundDoc\u001b[38;5;241m.\u001b[39mXlsDoc()\n\u001b[1;32m--> 710\u001b[0m doc\u001b[38;5;241m.\u001b[39msave(filename_or_stream, \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mget_biff_data())\n",
"File \u001b[1;32m~\\AppData\\Roaming\\Python\\Python311\\site-packages\\xlwt\\CompoundDoc.py:262\u001b[0m, in \u001b[0;36mXlsDoc.save\u001b[1;34m(self, file_name_or_filelike_obj, stream)\u001b[0m\n\u001b[0;32m 260\u001b[0m we_own_it \u001b[38;5;241m=\u001b[39m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28mhasattr\u001b[39m(f, \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mwrite\u001b[39m\u001b[38;5;124m'\u001b[39m)\n\u001b[0;32m 261\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m we_own_it:\n\u001b[1;32m--> 262\u001b[0m f \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mopen\u001b[39m(file_name_or_filelike_obj, \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mw+b\u001b[39m\u001b[38;5;124m'\u001b[39m)\n\u001b[0;32m 263\u001b[0m f\u001b[38;5;241m.\u001b[39mwrite(\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mheader)\n\u001b[0;32m 264\u001b[0m f\u001b[38;5;241m.\u001b[39mwrite(\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mpacked_MSAT_1st)\n",
"\u001b[1;31mPermissionError\u001b[0m: [Errno 13] Permission denied: '沥青数据项.xls'"
"\u001b[1;31mKeyboardInterrupt\u001b[0m Traceback (most recent call last)",
"Cell \u001b[1;32mIn[2], line 13\u001b[0m\n\u001b[0;32m 11\u001b[0m start_3(start_date,token,token_push)\n\u001b[0;32m 12\u001b[0m time\u001b[38;5;241m.\u001b[39msleep(\u001b[38;5;241m1\u001b[39m)\n\u001b[1;32m---> 13\u001b[0m start_2(start_date,token)\n\u001b[0;32m 14\u001b[0m start_date \u001b[38;5;241m+\u001b[39m\u001b[38;5;241m=\u001b[39m timedelta(days\u001b[38;5;241m=\u001b[39m\u001b[38;5;241m1\u001b[39m)\n",
"Cell \u001b[1;32mIn[1], line 600\u001b[0m, in \u001b[0;36mstart_2\u001b[1;34m(date, token)\u001b[0m\n\u001b[0;32m 593\u001b[0m read_xls_data()\n\u001b[0;32m 595\u001b[0m \u001b[38;5;66;03m# token = get_head_auth()\u001b[39;00m\n\u001b[0;32m 596\u001b[0m \u001b[38;5;66;03m# if not token:\u001b[39;00m\n\u001b[0;32m 597\u001b[0m \u001b[38;5;66;03m# return\u001b[39;00m\n\u001b[1;32m--> 600\u001b[0m datas \u001b[38;5;241m=\u001b[39m get_data_value(token, one_cols[\u001b[38;5;241m1\u001b[39m:],date)\n\u001b[0;32m 601\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m datas:\n\u001b[0;32m 602\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m\n",
"Cell \u001b[1;32mIn[1], line 126\u001b[0m, in \u001b[0;36mget_data_value\u001b[1;34m(token, dataItemNoList, date)\u001b[0m\n\u001b[0;32m 117\u001b[0m search_data \u001b[38;5;241m=\u001b[39m {\n\u001b[0;32m 118\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mdata\u001b[39m\u001b[38;5;124m\"\u001b[39m: {\n\u001b[0;32m 119\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mdate\u001b[39m\u001b[38;5;124m\"\u001b[39m: get_cur_time(date)[\u001b[38;5;241m0\u001b[39m],\n\u001b[1;32m (...)\u001b[0m\n\u001b[0;32m 123\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mfuncOperation\u001b[39m\u001b[38;5;124m\"\u001b[39m: \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m查询\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[0;32m 124\u001b[0m }\n\u001b[0;32m 125\u001b[0m headers \u001b[38;5;241m=\u001b[39m {\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mAuthorization\u001b[39m\u001b[38;5;124m\"\u001b[39m: token}\n\u001b[1;32m--> 126\u001b[0m search_res \u001b[38;5;241m=\u001b[39m requests\u001b[38;5;241m.\u001b[39mpost(url\u001b[38;5;241m=\u001b[39msearch_url, headers\u001b[38;5;241m=\u001b[39mheaders, json\u001b[38;5;241m=\u001b[39msearch_data, timeout\u001b[38;5;241m=\u001b[39m(\u001b[38;5;241m3\u001b[39m, \u001b[38;5;241m5\u001b[39m))\n\u001b[0;32m 127\u001b[0m search_value \u001b[38;5;241m=\u001b[39m json\u001b[38;5;241m.\u001b[39mloads(search_res\u001b[38;5;241m.\u001b[39mtext)[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mdata\u001b[39m\u001b[38;5;124m\"\u001b[39m]\n\u001b[0;32m 128\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m search_value:\n",
"File \u001b[1;32md:\\ProgramData\\anaconda3\\Lib\\site-packages\\requests\\api.py:115\u001b[0m, in \u001b[0;36mpost\u001b[1;34m(url, data, json, **kwargs)\u001b[0m\n\u001b[0;32m 103\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mpost\u001b[39m(url, data\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mNone\u001b[39;00m, json\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mNone\u001b[39;00m, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs):\n\u001b[0;32m 104\u001b[0m \u001b[38;5;250m \u001b[39m\u001b[38;5;124mr\u001b[39m\u001b[38;5;124;03m\"\"\"Sends a POST request.\u001b[39;00m\n\u001b[0;32m 105\u001b[0m \n\u001b[0;32m 106\u001b[0m \u001b[38;5;124;03m :param url: URL for the new :class:`Request` object.\u001b[39;00m\n\u001b[1;32m (...)\u001b[0m\n\u001b[0;32m 112\u001b[0m \u001b[38;5;124;03m :rtype: requests.Response\u001b[39;00m\n\u001b[0;32m 113\u001b[0m \u001b[38;5;124;03m \"\"\"\u001b[39;00m\n\u001b[1;32m--> 115\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m request(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mpost\u001b[39m\u001b[38;5;124m\"\u001b[39m, url, data\u001b[38;5;241m=\u001b[39mdata, json\u001b[38;5;241m=\u001b[39mjson, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs)\n",
"File \u001b[1;32md:\\ProgramData\\anaconda3\\Lib\\site-packages\\requests\\api.py:59\u001b[0m, in \u001b[0;36mrequest\u001b[1;34m(method, url, **kwargs)\u001b[0m\n\u001b[0;32m 55\u001b[0m \u001b[38;5;66;03m# By using the 'with' statement we are sure the session is closed, thus we\u001b[39;00m\n\u001b[0;32m 56\u001b[0m \u001b[38;5;66;03m# avoid leaving sockets open which can trigger a ResourceWarning in some\u001b[39;00m\n\u001b[0;32m 57\u001b[0m \u001b[38;5;66;03m# cases, and look like a memory leak in others.\u001b[39;00m\n\u001b[0;32m 58\u001b[0m \u001b[38;5;28;01mwith\u001b[39;00m sessions\u001b[38;5;241m.\u001b[39mSession() \u001b[38;5;28;01mas\u001b[39;00m session:\n\u001b[1;32m---> 59\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m session\u001b[38;5;241m.\u001b[39mrequest(method\u001b[38;5;241m=\u001b[39mmethod, url\u001b[38;5;241m=\u001b[39murl, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs)\n",
"File \u001b[1;32md:\\ProgramData\\anaconda3\\Lib\\site-packages\\requests\\sessions.py:589\u001b[0m, in \u001b[0;36mSession.request\u001b[1;34m(self, method, url, params, data, headers, cookies, files, auth, timeout, allow_redirects, proxies, hooks, stream, verify, cert, json)\u001b[0m\n\u001b[0;32m 584\u001b[0m send_kwargs \u001b[38;5;241m=\u001b[39m {\n\u001b[0;32m 585\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mtimeout\u001b[39m\u001b[38;5;124m\"\u001b[39m: timeout,\n\u001b[0;32m 586\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mallow_redirects\u001b[39m\u001b[38;5;124m\"\u001b[39m: allow_redirects,\n\u001b[0;32m 587\u001b[0m }\n\u001b[0;32m 588\u001b[0m send_kwargs\u001b[38;5;241m.\u001b[39mupdate(settings)\n\u001b[1;32m--> 589\u001b[0m resp \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39msend(prep, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39msend_kwargs)\n\u001b[0;32m 591\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m resp\n",
"File \u001b[1;32md:\\ProgramData\\anaconda3\\Lib\\site-packages\\requests\\sessions.py:703\u001b[0m, in \u001b[0;36mSession.send\u001b[1;34m(self, request, **kwargs)\u001b[0m\n\u001b[0;32m 700\u001b[0m start \u001b[38;5;241m=\u001b[39m preferred_clock()\n\u001b[0;32m 702\u001b[0m \u001b[38;5;66;03m# Send the request\u001b[39;00m\n\u001b[1;32m--> 703\u001b[0m r \u001b[38;5;241m=\u001b[39m adapter\u001b[38;5;241m.\u001b[39msend(request, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs)\n\u001b[0;32m 705\u001b[0m \u001b[38;5;66;03m# Total elapsed time of the request (approximately)\u001b[39;00m\n\u001b[0;32m 706\u001b[0m elapsed \u001b[38;5;241m=\u001b[39m preferred_clock() \u001b[38;5;241m-\u001b[39m start\n",
"File \u001b[1;32md:\\ProgramData\\anaconda3\\Lib\\site-packages\\requests\\adapters.py:486\u001b[0m, in \u001b[0;36mHTTPAdapter.send\u001b[1;34m(self, request, stream, timeout, verify, cert, proxies)\u001b[0m\n\u001b[0;32m 483\u001b[0m timeout \u001b[38;5;241m=\u001b[39m TimeoutSauce(connect\u001b[38;5;241m=\u001b[39mtimeout, read\u001b[38;5;241m=\u001b[39mtimeout)\n\u001b[0;32m 485\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[1;32m--> 486\u001b[0m resp \u001b[38;5;241m=\u001b[39m conn\u001b[38;5;241m.\u001b[39murlopen(\n\u001b[0;32m 487\u001b[0m method\u001b[38;5;241m=\u001b[39mrequest\u001b[38;5;241m.\u001b[39mmethod,\n\u001b[0;32m 488\u001b[0m url\u001b[38;5;241m=\u001b[39murl,\n\u001b[0;32m 489\u001b[0m body\u001b[38;5;241m=\u001b[39mrequest\u001b[38;5;241m.\u001b[39mbody,\n\u001b[0;32m 490\u001b[0m headers\u001b[38;5;241m=\u001b[39mrequest\u001b[38;5;241m.\u001b[39mheaders,\n\u001b[0;32m 491\u001b[0m redirect\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mFalse\u001b[39;00m,\n\u001b[0;32m 492\u001b[0m assert_same_host\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mFalse\u001b[39;00m,\n\u001b[0;32m 493\u001b[0m preload_content\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mFalse\u001b[39;00m,\n\u001b[0;32m 494\u001b[0m decode_content\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mFalse\u001b[39;00m,\n\u001b[0;32m 495\u001b[0m retries\u001b[38;5;241m=\u001b[39m\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mmax_retries,\n\u001b[0;32m 496\u001b[0m timeout\u001b[38;5;241m=\u001b[39mtimeout,\n\u001b[0;32m 497\u001b[0m chunked\u001b[38;5;241m=\u001b[39mchunked,\n\u001b[0;32m 498\u001b[0m )\n\u001b[0;32m 500\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m (ProtocolError, \u001b[38;5;167;01mOSError\u001b[39;00m) \u001b[38;5;28;01mas\u001b[39;00m err:\n\u001b[0;32m 501\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mConnectionError\u001b[39;00m(err, request\u001b[38;5;241m=\u001b[39mrequest)\n",
"File \u001b[1;32md:\\ProgramData\\anaconda3\\Lib\\site-packages\\urllib3\\connectionpool.py:791\u001b[0m, in \u001b[0;36mHTTPConnectionPool.urlopen\u001b[1;34m(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, preload_content, decode_content, **response_kw)\u001b[0m\n\u001b[0;32m 788\u001b[0m response_conn \u001b[38;5;241m=\u001b[39m conn \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m release_conn \u001b[38;5;28;01melse\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m\n\u001b[0;32m 790\u001b[0m \u001b[38;5;66;03m# Make the request on the HTTPConnection object\u001b[39;00m\n\u001b[1;32m--> 791\u001b[0m response \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_make_request(\n\u001b[0;32m 792\u001b[0m conn,\n\u001b[0;32m 793\u001b[0m method,\n\u001b[0;32m 794\u001b[0m url,\n\u001b[0;32m 795\u001b[0m timeout\u001b[38;5;241m=\u001b[39mtimeout_obj,\n\u001b[0;32m 796\u001b[0m body\u001b[38;5;241m=\u001b[39mbody,\n\u001b[0;32m 797\u001b[0m headers\u001b[38;5;241m=\u001b[39mheaders,\n\u001b[0;32m 798\u001b[0m chunked\u001b[38;5;241m=\u001b[39mchunked,\n\u001b[0;32m 799\u001b[0m retries\u001b[38;5;241m=\u001b[39mretries,\n\u001b[0;32m 800\u001b[0m response_conn\u001b[38;5;241m=\u001b[39mresponse_conn,\n\u001b[0;32m 801\u001b[0m preload_content\u001b[38;5;241m=\u001b[39mpreload_content,\n\u001b[0;32m 802\u001b[0m decode_content\u001b[38;5;241m=\u001b[39mdecode_content,\n\u001b[0;32m 803\u001b[0m \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mresponse_kw,\n\u001b[0;32m 804\u001b[0m )\n\u001b[0;32m 806\u001b[0m \u001b[38;5;66;03m# Everything went great!\u001b[39;00m\n\u001b[0;32m 807\u001b[0m clean_exit \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mTrue\u001b[39;00m\n",
"File \u001b[1;32md:\\ProgramData\\anaconda3\\Lib\\site-packages\\urllib3\\connectionpool.py:537\u001b[0m, in \u001b[0;36mHTTPConnectionPool._make_request\u001b[1;34m(self, conn, method, url, body, headers, retries, timeout, chunked, response_conn, preload_content, decode_content, enforce_content_length)\u001b[0m\n\u001b[0;32m 535\u001b[0m \u001b[38;5;66;03m# Receive the response from the server\u001b[39;00m\n\u001b[0;32m 536\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[1;32m--> 537\u001b[0m response \u001b[38;5;241m=\u001b[39m conn\u001b[38;5;241m.\u001b[39mgetresponse()\n\u001b[0;32m 538\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m (BaseSSLError, \u001b[38;5;167;01mOSError\u001b[39;00m) \u001b[38;5;28;01mas\u001b[39;00m e:\n\u001b[0;32m 539\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_raise_timeout(err\u001b[38;5;241m=\u001b[39me, url\u001b[38;5;241m=\u001b[39murl, timeout_value\u001b[38;5;241m=\u001b[39mread_timeout)\n",
"File \u001b[1;32md:\\ProgramData\\anaconda3\\Lib\\site-packages\\urllib3\\connection.py:461\u001b[0m, in \u001b[0;36mHTTPConnection.getresponse\u001b[1;34m(self)\u001b[0m\n\u001b[0;32m 458\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mresponse\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m HTTPResponse\n\u001b[0;32m 460\u001b[0m \u001b[38;5;66;03m# Get the response from http.client.HTTPConnection\u001b[39;00m\n\u001b[1;32m--> 461\u001b[0m httplib_response \u001b[38;5;241m=\u001b[39m \u001b[38;5;28msuper\u001b[39m()\u001b[38;5;241m.\u001b[39mgetresponse()\n\u001b[0;32m 463\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m 464\u001b[0m assert_header_parsing(httplib_response\u001b[38;5;241m.\u001b[39mmsg)\n",
"File \u001b[1;32md:\\ProgramData\\anaconda3\\Lib\\http\\client.py:1386\u001b[0m, in \u001b[0;36mHTTPConnection.getresponse\u001b[1;34m(self)\u001b[0m\n\u001b[0;32m 1384\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m 1385\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[1;32m-> 1386\u001b[0m response\u001b[38;5;241m.\u001b[39mbegin()\n\u001b[0;32m 1387\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mConnectionError\u001b[39;00m:\n\u001b[0;32m 1388\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mclose()\n",
"File \u001b[1;32md:\\ProgramData\\anaconda3\\Lib\\http\\client.py:325\u001b[0m, in \u001b[0;36mHTTPResponse.begin\u001b[1;34m(self)\u001b[0m\n\u001b[0;32m 323\u001b[0m \u001b[38;5;66;03m# read until we get a non-100 response\u001b[39;00m\n\u001b[0;32m 324\u001b[0m \u001b[38;5;28;01mwhile\u001b[39;00m \u001b[38;5;28;01mTrue\u001b[39;00m:\n\u001b[1;32m--> 325\u001b[0m version, status, reason \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_read_status()\n\u001b[0;32m 326\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m status \u001b[38;5;241m!=\u001b[39m CONTINUE:\n\u001b[0;32m 327\u001b[0m \u001b[38;5;28;01mbreak\u001b[39;00m\n",
"File \u001b[1;32md:\\ProgramData\\anaconda3\\Lib\\http\\client.py:286\u001b[0m, in \u001b[0;36mHTTPResponse._read_status\u001b[1;34m(self)\u001b[0m\n\u001b[0;32m 285\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21m_read_status\u001b[39m(\u001b[38;5;28mself\u001b[39m):\n\u001b[1;32m--> 286\u001b[0m line \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mstr\u001b[39m(\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mfp\u001b[38;5;241m.\u001b[39mreadline(_MAXLINE \u001b[38;5;241m+\u001b[39m \u001b[38;5;241m1\u001b[39m), \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124miso-8859-1\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[0;32m 287\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mlen\u001b[39m(line) \u001b[38;5;241m>\u001b[39m _MAXLINE:\n\u001b[0;32m 288\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m LineTooLong(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mstatus line\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n",
"File \u001b[1;32md:\\ProgramData\\anaconda3\\Lib\\socket.py:706\u001b[0m, in \u001b[0;36mSocketIO.readinto\u001b[1;34m(self, b)\u001b[0m\n\u001b[0;32m 704\u001b[0m \u001b[38;5;28;01mwhile\u001b[39;00m \u001b[38;5;28;01mTrue\u001b[39;00m:\n\u001b[0;32m 705\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[1;32m--> 706\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_sock\u001b[38;5;241m.\u001b[39mrecv_into(b)\n\u001b[0;32m 707\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m timeout:\n\u001b[0;32m 708\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_timeout_occurred \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mTrue\u001b[39;00m\n",
"\u001b[1;31mKeyboardInterrupt\u001b[0m: "
]
}
],
"source": [
"from datetime import datetime, timedelta\n",
"\n",
"start_date = datetime(2024, 12, 31)\n",
"end_date = datetime(2025, 1, 2)\n",
"start_date = datetime(2025, 2, 1)\n",
"end_date = datetime(2025, 3, 1)\n",
"token = get_head_auth()\n",
"\n",
"token_push = get_head_push_auth()\n",
"\n",
"while start_date < end_date:\n",
" print(start_date.strftime('%Y%m%d'))\n",
" start_3(start_date)\n",
" start_3(start_date,token,token_push)\n",
" time.sleep(1)\n",
" start_2(start_date)\n",
" start_2(start_date,token)\n",
" start_date += timedelta(days=1)"
]
},

View File

@ -159,9 +159,9 @@ table_name = 'v_tbl_crude_oil_warning'
### 开关
is_train = True # 是否训练
is_train = False # 是否训练
is_debug = False # 是否调试
is_eta = True # 是否使用eta接口
is_eta = False # 是否使用eta接口
is_market = True # 是否通过市场信息平台获取特征 ,在is_eta 为true 的情况下生效
is_timefurture = True # 是否使用时间特征
is_fivemodels = False # 是否使用之前保存的最佳的5个模型
@ -182,7 +182,7 @@ print("数据库连接成功",host,dbname,dbusername)
# 数据截取日期
start_year = 2020 # 数据开始年份
start_year = 1993 # 数据开始年份
end_time = '' # 数据截取日期
freq = 'M' # 时间频率,"D": 天 "W": 周"M": 月"Q": 季度"A": 年 "H": 小时 "T": 分钟 "S": 秒 "B": 工作日
delweekenday = True if freq == 'B' else False # 是否删除周末数据

View File

@ -42,7 +42,8 @@ plt.rcParams['axes.unicode_minus'] = False # 用来正常显示负号
# from config_jingbo_pro import *
# from config_jingbo import *
from config_jingbo_zhoudu import *
# from config_jingbo_zhoudu import *
from config_jingbo_yuedu import *
# from config_yongan import *
# from config_juxiting import *
# from config_juxiting_zhoudu import *

View File

@ -255,15 +255,15 @@ def predict_main():
logger.info('训练数据绘图end')
# 模型报告
logger.info('制作报告ing')
title = f'{settings}--{end_time}-预测报告' # 报告标题
reportname = f'Brent原油大模型月度预测--{end_time}.pdf' # 报告文件名
reportname = reportname.replace(':', '-') # 替换冒号
brent_export_pdf(dataset=dataset,num_models = 5 if is_fivemodels else 22,time=end_time,
reportname=reportname,sqlitedb=sqlitedb),
# logger.info('制作报告ing')
# title = f'{settings}--{end_time}-预测报告' # 报告标题
# reportname = f'Brent原油大模型月度预测--{end_time}.pdf' # 报告文件名
# reportname = reportname.replace(':', '-') # 替换冒号
# brent_export_pdf(dataset=dataset,num_models = 5 if is_fivemodels else 22,time=end_time,
# reportname=reportname,sqlitedb=sqlitedb),
logger.info('制作报告end')
logger.info('模型训练完成')
# logger.info('制作报告end')
# logger.info('模型训练完成')
# # LSTM 单变量模型
# ex_Lstm(df,input_seq_len=input_size,output_seq_len=horizon,is_debug=is_debug,dataset=dataset)
@ -291,7 +291,7 @@ if __name__ == '__main__':
global end_time
is_on = True
# 遍历2024-11-25 到 2024-12-3 之间的工作日日期
for i_time in pd.date_range('2024-12-1', '2025-2-1', freq='ME'):
for i_time in pd.date_range('2022-6-1', '2025-3-1', freq='ME'):
end_time = i_time.strftime('%Y-%m-%d')
predict_main()

View File

@ -837,13 +837,23 @@ def model_losss_yongan(sqlitedb,end_time,table_name_prefix):
def model_losss(sqlitedb,end_time):
global dataset
global rote
# 从数据库取最佳模型,如果没有表,先自定义空,后面根据模型评估取第一个
try:
most_model = [sqlitedb.select_data('most_model',columns=['most_common_model'],order_by='ds desc',limit=1).values[0][0]]
most_model_name = most_model[0]
except:
most_model_name = ''
# 预测数据处理 predict
# df_combined = loadcsv(os.path.join(dataset,"cross_validation.csv"))
# df_combined = dateConvert(df_combined)
try:
df_combined = sqlitedb.select_data('accuracy',where_condition=f"created_dt <= '{end_time}'")
if len(df_combined) < 10:
len(df_combined) + ''
except:
df_combined = loadcsv(os.path.join(dataset,"cross_validation.csv"))
df_combined = dateConvert(df_combined)
df_combined['CREAT_DATE'] = df_combined['cutoff']
df_combined4 = df_combined.copy() # 备份df_combined,后面画图需要
# 删除缺失值大于80%的列
logger.info(df_combined.shape)
@ -860,11 +870,13 @@ def model_losss(sqlitedb,end_time):
# 然后筛选出那些 cutoff 等于 max_cutoff 的行,这样就得到了每个分组中 cutoff 最大的行,并保留了其他列
df_combined = df_combined[df_combined['CREAT_DATE'] == df_combined['max_cutoff']]
# 删除模型生成的cutoff列
df_combined.drop(columns=['CREAT_DATE', 'max_cutoff','created_dt','min_within_quantile','max_within_quantile','id','min_price','max_price','LOW_PRICE','HIGH_PRICE','mean'], inplace=True,errors='ignore')
df_combined.drop(columns=['CREAT_DATE', 'max_cutoff','created_dt','min_within_quantile','max_within_quantile','id','min_price','max_price','LOW_PRICE','HIGH_PRICE','mean','cutoff'], inplace=True,errors='ignore')
# 获取模型名称
modelnames = df_combined.columns.to_list()[1:]
if 'y' in modelnames:
modelnames.remove('y')
if 'cutoff' in modelnames:
modelnames.remove('cutoff')
df_combined3 = df_combined.copy() # 备份df_combined,后面画图需要
@ -886,6 +898,7 @@ def model_losss(sqlitedb,end_time):
model_results3 = model_results3.sort_values(by='平均平方误差(MSE)', ascending=True)
model_results3.to_csv(os.path.join(dataset,"model_evaluation.csv"),index=False)
modelnames = model_results3['模型(Model)'].tolist()
most_model_name = modelnames[0]
allmodelnames = modelnames.copy()
# 保存5个最佳模型的名称
if len(modelnames) > 5:
@ -1158,8 +1171,9 @@ def model_losss(sqlitedb,end_time):
for i, j in zip(df['ds'], df['y']):
plt.text(i, j, str(j), ha='center', va='bottom')
for model in most_model:
plt.plot(df['ds'], df[model], label=model,marker='o')
# for model in most_model:
# plt.plot(df['ds'], df[model], label=model,marker='o')
plt.plot(df['ds'], df[most_model_name], label=model,marker='o')
# 当前日期画竖虚线
plt.axvline(x=df['ds'].iloc[-horizon], color='r', linestyle='--')
plt.legend()
@ -1247,10 +1261,10 @@ def model_losss(sqlitedb,end_time):
plt.savefig(os.path.join(dataset,'模型评估.png'), bbox_inches='tight')
plt.close()
_plt_predict_ture(df_combined3)
_plt_modeltopten_predict_ture(df_combined4)
_plt_predict_table(df_combined3)
_plt_model_results3()
# _plt_predict_ture(df_combined3)
# _plt_modeltopten_predict_ture(df_combined4)
# _plt_predict_table(df_combined3)
# _plt_model_results3()
return model_results3