{ "cells": [ { "cell_type": "code", "execution_count": 53, "id": "d40f14fe", "metadata": {}, "outputs": [], "source": [ "from login_for_cookie import Vc\n", "import requests\n", "import pandas as pd\n", "import re \n", "cookie = Vc()\n", "header = {\"cookie\":cookie}\n", "bank_flow_df = pd.read_clipboard()" ] }, { "cell_type": "code", "execution_count": null, "id": "fa7b13e9", "metadata": {}, "outputs": [], "source": [ "result = []\n", "for idx,row in bank_flow_df.iterrows():\n", " print(idx)\n", " url = \"https://cp.maso.hk/index.php?main=store_trade_finance_management&navlist=finance_list&s_payment_serial_number=%s\"% row[\"确认单号\"]\n", " response = requests.get(url,headers=header)\n", " text = response.text\n", " dfs = pd.read_html(text)\n", " result.append(dfs[1])" ] }, { "cell_type": "code", "execution_count": null, "id": "31a09d55", "metadata": {}, "outputs": [], "source": [ "result" ] }, { "cell_type": "code", "execution_count": 56, "id": "8a60ba2c", "metadata": {}, "outputs": [], "source": [ "result[0]\n", "new_list = []\n", "for df in result:\n", " for idx,row in df.iterrows():\n", " \n", " currency_pattern = re.compile(r\"EUR|USD|GBP|JPY|CNY|AUD|CAD|CHF|DKK|HKD|INR|KRW|MXN|NOK|NZD|RUB|SEK|SGD|THB|TRY|ZAR\")\n", " id = row[0]\n", " currency = re.findall(currency_pattern,row[5])\n", " if len(currency) == 0:\n", " continue\n", " amount = row[6]\n", " detail = row[7]\n", " temp_tuple = (currency[0],amount,detail,id)\n", " new_list.append(temp_tuple)" ] }, { "cell_type": "code", "execution_count": null, "id": "cdf4863b", "metadata": {}, "outputs": [], "source": [ "new_list" ] }, { "cell_type": "code", "execution_count": 58, "id": "dd54eaeb", "metadata": {}, "outputs": [], "source": [ "import pandas as pd\n", "# 正数大概率没有可以处理的包裹\n", "# 初始化结果列表\n", "result_list = []\n", "\n", "for i in new_list:\n", " try:\n", " id = i[3]\n", " currency = i[0]\n", " amount = float(i[1]) \n", " \n", " # 判断收入或支出\n", " if amount > 0:\n", " type = 'income'\n", " else:\n", " type = 'expense'\n", " if i[2] == \"--\":\n", " detail = \"--\"\n", " else:\n", " \n", " text_split = i[2].split()\n", " text_split = text_split[3:]\n", " if len(text_split) > 3:\n", " if text_split[1] == \"备用金\":\n", " temp_dict = [{'支付手续费':text_split[0], '支付平台':text_split[1], '支付平台流水':text_split[2] +text_split[3] }]\n", " else:\n", " num = (len(text_split))//3\n", " temp_dict = []\n", " for j in range(num):\n", " temp_dict.append({'支付手续费':text_split[j*3], '支付平台':text_split[1+j*3], '支付平台流水':text_split[2+j*3] })\n", " else :\n", " temp_dict = [{'支付手续费':text_split[0], '支付平台':text_split[1], '支付平台流水':text_split[2] if len(text_split) > 2 else \"--\"}]\n", " \n", " detail = temp_dict\n", " except Exception as e:\n", " print(e)\n", " # 计算累计总价(假设 total_price 是所有 amount 的累加)\n", " if isinstance(detail,list):\n", " commission = sum(float(item[\"支付手续费\"]) for item in detail)\n", " else:\n", " commission = 0\n", " # 将当前记录添加到结果列表\n", " result_list.append([id,currency, amount, type, detail, commission])\n", "# 最后一次性创建 DataFrame\n", "result_df = pd.DataFrame(result_list, columns=[\"id\",'currency', 'amount', 'type', 'detail', 'commission'])\n", "result_df.to_clipboard()\n", "\n" ] }, { "cell_type": "code", "execution_count": 59, "id": "06552300", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "-16659742.720000004 419510.17 3720.1500000000015\n" ] } ], "source": [ "nsum = 0\n", "total_commission = 0\n", "isum = 0\n", "for idx,row in result_df.iterrows():\n", " row\n", " # if i[2] ==\"--\":\n", " # continue\n", " # if \"SAIR\" in str(i[2]):\n", " # print(i)\n", " # continue\n", " if row[\"currency\"] == \"CNY\":\n", " rate = 1\n", " real_rate = 1\n", " if row[\"currency\"] == \"USD\":\n", " rate = 7\n", " real_rate = 7.16\n", " if row[\"currency\"] == \"EUR\":\n", " rate = 8\n", " real_rate = 7.75 \n", " if row[\"currency\"] == \"GBP\":\n", " rate = 9\n", " real_rate = 9.1\n", " if row[\"currency\"] == \"JPY\":\n", " rate = 0.05\n", " real_rate = 0.0485\n", " if row[\"currency\"] == \"AUD\":\n", " rate = 5\n", " real_rate = 4.65\n", " if row[\"currency\"] == \"CAD\":\n", " rate = 5\n", " real_rate = 5.2\n", " if row[\"currency\"] == \"HKD\":\n", " rate = 1\n", " real_rate = 0.92\n", " if row[\"amount\"] > 0:\n", " nprice = row[\"amount\"]*rate\n", " nsum += nprice\n", " if row[\"amount\"] < 0:\n", " isum += row[\"amount\"]*rate\n", " total_commission += row[\"commission\"]*rate\n", "print(isum,nsum,total_commission)" ] }, { "cell_type": "code", "execution_count": 11, "id": "66a844c8", "metadata": {}, "outputs": [ { "data": { "application/vnd.microsoft.datawrangler.viewer.v0+json": { "columns": [ { "name": "index", "rawType": "int64", "type": "integer" }, { "name": "id", "rawType": "object", "type": "string" }, { "name": "currency", "rawType": "object", "type": "string" }, { "name": "amount", "rawType": "float64", "type": "float" }, { "name": "type", "rawType": "object", "type": "string" }, { "name": "detail", "rawType": "object", "type": "unknown" }, { "name": "commission", "rawType": "float64", "type": "float" } ], "ref": "26714892-92f0-4782-ae4c-1bb6a2ddf4ae", "rows": [ [ "0", "2539410", "CNY", "-27.37", "expense", "[{'支付手续费': '0.00', '支付平台': 'LLP', '支付平台流水': '202506302346671'}]", "0.0" ], [ "1", "2539409", "CNY", "-292.11", "expense", "[{'支付手续费': '0.00', '支付平台': 'LLP', '支付平台流水': '202506302346671'}]", "0.0" ], [ "2", "2539408", "CNY", "-8085.36", "expense", "[{'支付手续费': '0.00', '支付平台': 'LLP', '支付平台流水': '202506302346671'}]", "0.0" ], [ "3", "2539398", "USD", "-1650.0", "expense", "[{'支付手续费': '0.00', '支付平台': 'LLP', '支付平台流水': '202506302338229'}]", "0.0" ], [ "4", "2539397", "CNY", "-5316.0", "expense", "[{'支付手续费': '0.00', '支付平台': 'LLP', '支付平台流水': '202506302336498'}]", "0.0" ], [ "5", "2539396", "CNY", "-4478.0", "expense", "[{'支付手续费': '0.00', '支付平台': 'LLP', '支付平台流水': '202506302334980'}]", "0.0" ], [ "6", "2537147", "CAD", "-1551.86", "expense", "[{'支付手续费': '0.00', '支付平台': 'LLP', '支付平台流水': '202506270507518'}]", "0.0" ], [ "7", "2537146", "CNY", "-12825.0", "expense", "[{'支付手续费': '0.00', '支付平台': 'LLP', '支付平台流水': '202506270500474'}]", "0.0" ], [ "8", "2536341", "USD", "-4930.56", "expense", "[{'支付手续费': '0.00', '支付平台': 'LLP', '支付平台流水': '202506269636827'}]", "0.0" ], [ "9", "2534840", "CNY", "1000.0", "income", "[{'支付手续费': '0.00', '支付平台': 'LLP', '支付平台流水': '202506258748788'}]", "0.0" ], [ "10", "2534807", "CNY", "-22131.0", "expense", "[{'支付手续费': '0.00', '支付平台': 'LLP', '支付平台流水': '202506258705060'}]", "0.0" ], [ "11", "2534806", "CNY", "-1250.0", "expense", "[{'支付手续费': '0.00', '支付平台': 'LLP', '支付平台流水': '202506258705057'}]", "0.0" ], [ "12", "2534805", "CNY", "-19200.0", "expense", "[{'支付手续费': '0.00', '支付平台': 'LLP', '支付平台流水': '202506258704172'}]", "0.0" ], [ "13", "2534804", "CNY", "-4000.0", "expense", "[{'支付手续费': '0.00', '支付平台': 'LLP', '支付平台流水': '202506258704169'}]", "0.0" ], [ "14", "2534803", "CNY", "-8140.0", "expense", "[{'支付手续费': '0.00', '支付平台': 'LLP', '支付平台流水': '202506258704169'}]", "0.0" ], [ "15", "2534802", "CNY", "-800.0", "expense", "[{'支付手续费': '0.00', '支付平台': 'LLP', '支付平台流水': '202506258704169'}]", "0.0" ], [ "16", "2534801", "CNY", "-22975.5", "expense", "[{'支付手续费': '0.00', '支付平台': 'LLP', '支付平台流水': '202506258703320'}]", "0.0" ], [ "17", "2534799", "CNY", "-7975.0", "expense", "[{'支付手续费': '0.00', '支付平台': 'LLP', '支付平台流水': '202506258703317'}]", "0.0" ], [ "18", "2534796", "CNY", "-2610.0", "expense", "[{'支付手续费': '0.00', '支付平台': 'LLP', '支付平台流水': '202506258703314'}]", "0.0" ], [ "19", "2534778", "USD", "-614.59", "expense", "[{'支付手续费': '0.00', '支付平台': 'LLP', '支付平台流水': '202506258690045'}]", "0.0" ], [ "20", "2534779", "USD", "-2897.2", "expense", "[{'支付手续费': '0.00', '支付平台': 'LLP', '支付平台流水': '202506258689049'}]", "0.0" ], [ "21", "2532487", "USD", "-643.2", "expense", "[{'支付手续费': '0.00', '支付平台': 'LLP', '支付平台流水': '202506236772001'}]", "0.0" ], [ "22", "2532486", "CAD", "-120.51", "expense", "[{'支付手续费': '0.00', '支付平台': 'LLP', '支付平台流水': '202506236767954'}]", "0.0" ], [ "23", "2532482", "CAD", "-2349.83", "expense", "[{'支付手续费': '0.00', '支付平台': 'LLP', '支付平台流水': '202506236767954'}]", "0.0" ], [ "24", "2532478", "USD", "-11662.0", "expense", "[{'支付手续费': '0.00', '支付平台': 'LLP', '支付平台流水': '202506236765959'}]", "0.0" ], [ "25", "2532474", "CNY", "-5130.0", "expense", "[{'支付手续费': '0.00', '支付平台': 'LLP', '支付平台流水': '202506236763136'}]", "0.0" ], [ "26", "2532476", "CNY", "-2239.0", "expense", "[{'支付手续费': '0.00', '支付平台': 'LLP', '支付平台流水': '202506236762572'}]", "0.0" ], [ "27", "2529569", "USD", "-1615.0", "expense", "[{'支付手续费': '0.00', '支付平台': 'LLP', '支付平台流水': '202506194219460'}]", "0.0" ], [ "28", "2529568", "USD", "-562.2", "expense", "[{'支付手续费': '0.00', '支付平台': 'LLP', '支付平台流水': '202506194218716'}]", "0.0" ], [ "29", "2529533", "USD", "-40.0", "expense", "[{'支付手续费': '0.00', '支付平台': 'LLP', '支付平台流水': '202506194186199'}]", "0.0" ], [ "30", "2529532", "CNY", "-900.0", "expense", "[{'支付手续费': '0.00', '支付平台': 'LLP', '支付平台流水': '202506194184330'}]", "0.0" ], [ "31", "2523479", "USD", "-11772.44", "expense", "[{'支付手续费': '0.00', '支付平台': 'LLP', '支付平台流水': '202506172667065'}]", "0.0" ], [ "32", "2523478", "CNY", "-2239.0", "expense", "[{'支付手续费': '0.00', '支付平台': 'LLP', '支付平台流水': '202506172666090'}]", "0.0" ], [ "33", "2523459", "USD", "10000.0", "income", "[{'支付手续费': '0.00', '支付平台': 'LLP', '支付平台流水': '202506172564387'}]", "0.0" ], [ "34", "2520859", "CNY", "-2565.0", "expense", "[{'支付手续费': '0.00', '支付平台': 'LLP', '支付平台流水': '202506140402278'}]", "0.0" ], [ "35", "2517883", "CAD", "-2821.74", "expense", "[{'支付手续费': '0.00', '支付平台': 'LLP', '支付平台流水': '202506118309501'}, {'支付手续费': '0.00', '支付平台': 'LLP', '支付平台流水': '202506064652360'}]", "0.0" ], [ "36", "2517880", "CAD", "-181.44", "expense", "[{'支付手续费': '0.00', '支付平台': 'LLP', '支付平台流水': '202506118307332'}]", "0.0" ], [ "37", "2517879", "CAD", "-1065.42", "expense", "[{'支付手续费': '0.00', '支付平台': 'LLP', '支付平台流水': '202506118307332'}]", "0.0" ], [ "38", "2517878", "CAD", "-722.05", "expense", "[{'支付手续费': '0.00', '支付平台': 'LLP', '支付平台流水': '202506118307332'}]", "0.0" ], [ "39", "2517877", "JPY", "98277.0", "income", "[{'支付手续费': '0.00', '支付平台': 'LLP', '支付平台流水': '202506118305370'}]", "0.0" ], [ "40", "2515282", "CNY", "-6717.0", "expense", "[{'支付手续费': '0.00', '支付平台': 'LLP', '支付平台流水': '202506096502436'}]", "0.0" ], [ "41", "2515283", "CNY", "-189520.0", "expense", "[{'支付手续费': '0.00', '支付平台': 'LLP', '支付平台流水': '202506096502433'}]", "0.0" ], [ "42", "2515260", "USD", "-378.7", "expense", "[{'支付手续费': '0.00', '支付平台': 'LLP', '支付平台流水': '202506096432710'}]", "0.0" ], [ "43", "2511413", "USD", "-16740.0", "expense", "[{'支付手续费': '0.00', '支付平台': 'LLP', '支付平台流水': '202506064662557'}]", "0.0" ], [ "44", "2511411", "CNY", "-4680.0", "expense", "[{'支付手续费': '0.00', '支付平台': 'LLP', '支付平台流水': '202506064660973'}]", "0.0" ], [ "45", "2511395", "CAD", "2086.5", "income", "[{'支付手续费': '0.00', '支付平台': 'LLP', '支付平台流水': '202506064652360'}]", "0.0" ], [ "46", "2509570", "CNY", "-5340.0", "expense", "[{'支付手续费': '0.00', '支付平台': 'LLP', '支付平台流水': '202506042925647'}]", "0.0" ], [ "47", "2509569", "CNY", "-4000.0", "expense", "[{'支付手续费': '0.00', '支付平台': 'LLP', '支付平台流水': '202506042925647'}]", "0.0" ], [ "48", "2509568", "CAD", "-2086.5", "expense", "[{'支付手续费': '0.00', '支付平台': 'LLP', '支付平台流水': '202506042924138'}]", "0.0" ], [ "49", "2509251", "CNY", "-13694.0", "expense", "[{'支付手续费': '0.00', '支付平台': 'LLP', '支付平台流水': '202506042662235'}]", "0.0" ] ], "shape": { "columns": 6, "rows": 250 } }, "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
idcurrencyamounttypedetailcommission
02539410CNY-27.37expense[{'支付手续费': '0.00', '支付平台': 'LLP', '支付平台流水': '2...0.00
12539409CNY-292.11expense[{'支付手续费': '0.00', '支付平台': 'LLP', '支付平台流水': '2...0.00
22539408CNY-8085.36expense[{'支付手续费': '0.00', '支付平台': 'LLP', '支付平台流水': '2...0.00
32539398USD-1650.00expense[{'支付手续费': '0.00', '支付平台': 'LLP', '支付平台流水': '2...0.00
42539397CNY-5316.00expense[{'支付手续费': '0.00', '支付平台': 'LLP', '支付平台流水': '2...0.00
.....................
2452541577USD-41.50expense[{'支付手续费': '0.00', '支付平台': 'Airwallex', '支付平台流...0.00
2462541576USD-307.49expense[{'支付手续费': '0.01', '支付平台': 'Airwallex', '支付平台流...0.01
2472541575USD-2554.52expense[{'支付手续费': '0.05', '支付平台': 'Airwallex', '支付平台流...0.05
2482541563USD32.26income[{'支付手续费': '0.00', '支付平台': 'Airwallex', '支付平台流...0.00
2492541562USD-50806.55expense[{'支付手续费': '0.95', '支付平台': 'Airwallex', '支付平台流...0.95
\n", "

250 rows × 6 columns

\n", "
" ], "text/plain": [ " id currency amount type \\\n", "0 2539410 CNY -27.37 expense \n", "1 2539409 CNY -292.11 expense \n", "2 2539408 CNY -8085.36 expense \n", "3 2539398 USD -1650.00 expense \n", "4 2539397 CNY -5316.00 expense \n", ".. ... ... ... ... \n", "245 2541577 USD -41.50 expense \n", "246 2541576 USD -307.49 expense \n", "247 2541575 USD -2554.52 expense \n", "248 2541563 USD 32.26 income \n", "249 2541562 USD -50806.55 expense \n", "\n", " detail commission \n", "0 [{'支付手续费': '0.00', '支付平台': 'LLP', '支付平台流水': '2... 0.00 \n", "1 [{'支付手续费': '0.00', '支付平台': 'LLP', '支付平台流水': '2... 0.00 \n", "2 [{'支付手续费': '0.00', '支付平台': 'LLP', '支付平台流水': '2... 0.00 \n", "3 [{'支付手续费': '0.00', '支付平台': 'LLP', '支付平台流水': '2... 0.00 \n", "4 [{'支付手续费': '0.00', '支付平台': 'LLP', '支付平台流水': '2... 0.00 \n", ".. ... ... \n", "245 [{'支付手续费': '0.00', '支付平台': 'Airwallex', '支付平台流... 0.00 \n", "246 [{'支付手续费': '0.01', '支付平台': 'Airwallex', '支付平台流... 0.01 \n", "247 [{'支付手续费': '0.05', '支付平台': 'Airwallex', '支付平台流... 0.05 \n", "248 [{'支付手续费': '0.00', '支付平台': 'Airwallex', '支付平台流... 0.00 \n", "249 [{'支付手续费': '0.95', '支付平台': 'Airwallex', '支付平台流... 0.95 \n", "\n", "[250 rows x 6 columns]" ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "result_df" ] }, { "cell_type": "code", "execution_count": 60, "id": "da5c45de", "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\125592908.py:9: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", " capital_flow_df = pd.concat([temp_df,capital_flow_df])\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\125592908.py:10: FutureWarning: The provided callable is currently using SeriesGroupBy.sum. In a future version of pandas, the provided callable will be used directly. To keep current behavior pass the string \"sum\" instead.\n", " capital_flow_df_g = capital_flow_df.groupby(['流水号','平台',\"币种\"]).agg({'资金记录ID':list,'金额':sum,'手续费':sum}).reset_index()\n" ] } ], "source": [ "#反向处理,按照流水为主键用LIST的方式存储记录ID\n", "\n", "capital_flow_df = pd.DataFrame(columns=['流水号','平台','资金记录ID',\"金额\",\"手续费\",\"币种\"])\n", "for idx,row in result_df.iterrows():\n", " if isinstance(row[\"detail\"],list)==False:\n", " continue\n", " for i in row[\"detail\"]:\n", " temp_df = pd.DataFrame({'流水号':i['支付平台流水'],'平台':i['支付平台'],'资金记录ID':row['id'],\"金额\":row['amount'],\"手续费\":float(i['支付手续费']),\"币种\":row[\"currency\"]},index=[0])\n", " capital_flow_df = pd.concat([temp_df,capital_flow_df])\n", "capital_flow_df_g = capital_flow_df.groupby(['流水号','平台',\"币种\"]).agg({'资金记录ID':list,'金额':sum,'手续费':sum}).reset_index()\n", "capital_flow_df_g.to_clipboard()" ] }, { "cell_type": "code", "execution_count": null, "id": "2ba0fe33", "metadata": {}, "outputs": [], "source": [ "tail_result = []\n", "\n", "for idx,row in capital_flow_df_g.iterrows():\n", " print(row[\"流水号\"])\n", " if row[\"流水号\"] == \"--\":\n", " continue \n", " url = \"https://cp.maso.hk/index.php?main=fin_settle_express&navlist=settle&s_payment_serial_number=%s\"% row[\"流水号\"]\n", " response = requests.get(url,headers=header)\n", " text = response.text\n", " dfs = pd.read_html(text)\n", " tail_result.append(dfs[1])" ] }, { "cell_type": "code", "execution_count": 66, "id": "f2a15915", "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1371936810.py:74: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",3:\"付款账户\",16:\"确认时间\",18:\"支付时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1371936810.py:75: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", " tail_df = pd.concat([tail_df, result_df], axis=0)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1371936810.py:74: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",3:\"付款账户\",16:\"确认时间\",18:\"支付时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1371936810.py:74: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",3:\"付款账户\",16:\"确认时间\",18:\"支付时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1371936810.py:74: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",3:\"付款账户\",16:\"确认时间\",18:\"支付时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1371936810.py:74: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",3:\"付款账户\",16:\"确认时间\",18:\"支付时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1371936810.py:74: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",3:\"付款账户\",16:\"确认时间\",18:\"支付时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1371936810.py:74: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",3:\"付款账户\",16:\"确认时间\",18:\"支付时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1371936810.py:74: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",3:\"付款账户\",16:\"确认时间\",18:\"支付时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1371936810.py:74: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",3:\"付款账户\",16:\"确认时间\",18:\"支付时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1371936810.py:74: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",3:\"付款账户\",16:\"确认时间\",18:\"支付时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1371936810.py:74: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",3:\"付款账户\",16:\"确认时间\",18:\"支付时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1371936810.py:74: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",3:\"付款账户\",16:\"确认时间\",18:\"支付时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1371936810.py:74: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",3:\"付款账户\",16:\"确认时间\",18:\"支付时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1371936810.py:74: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",3:\"付款账户\",16:\"确认时间\",18:\"支付时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1371936810.py:74: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",3:\"付款账户\",16:\"确认时间\",18:\"支付时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1371936810.py:74: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",3:\"付款账户\",16:\"确认时间\",18:\"支付时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1371936810.py:74: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",3:\"付款账户\",16:\"确认时间\",18:\"支付时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1371936810.py:74: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",3:\"付款账户\",16:\"确认时间\",18:\"支付时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1371936810.py:74: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",3:\"付款账户\",16:\"确认时间\",18:\"支付时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1371936810.py:74: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",3:\"付款账户\",16:\"确认时间\",18:\"支付时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1371936810.py:74: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",3:\"付款账户\",16:\"确认时间\",18:\"支付时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1371936810.py:74: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",3:\"付款账户\",16:\"确认时间\",18:\"支付时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1371936810.py:74: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",3:\"付款账户\",16:\"确认时间\",18:\"支付时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1371936810.py:74: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",3:\"付款账户\",16:\"确认时间\",18:\"支付时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1371936810.py:74: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",3:\"付款账户\",16:\"确认时间\",18:\"支付时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1371936810.py:74: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",3:\"付款账户\",16:\"确认时间\",18:\"支付时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1371936810.py:74: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",3:\"付款账户\",16:\"确认时间\",18:\"支付时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1371936810.py:74: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",3:\"付款账户\",16:\"确认时间\",18:\"支付时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1371936810.py:74: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",3:\"付款账户\",16:\"确认时间\",18:\"支付时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1371936810.py:74: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",3:\"付款账户\",16:\"确认时间\",18:\"支付时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1371936810.py:74: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",3:\"付款账户\",16:\"确认时间\",18:\"支付时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1371936810.py:74: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",3:\"付款账户\",16:\"确认时间\",18:\"支付时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1371936810.py:74: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",3:\"付款账户\",16:\"确认时间\",18:\"支付时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1371936810.py:74: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",3:\"付款账户\",16:\"确认时间\",18:\"支付时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1371936810.py:74: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",3:\"付款账户\",16:\"确认时间\",18:\"支付时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1371936810.py:74: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",3:\"付款账户\",16:\"确认时间\",18:\"支付时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1371936810.py:74: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",3:\"付款账户\",16:\"确认时间\",18:\"支付时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1371936810.py:74: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",3:\"付款账户\",16:\"确认时间\",18:\"支付时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1371936810.py:74: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",3:\"付款账户\",16:\"确认时间\",18:\"支付时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1371936810.py:74: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",3:\"付款账户\",16:\"确认时间\",18:\"支付时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1371936810.py:74: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",3:\"付款账户\",16:\"确认时间\",18:\"支付时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1371936810.py:74: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",3:\"付款账户\",16:\"确认时间\",18:\"支付时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1371936810.py:74: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",3:\"付款账户\",16:\"确认时间\",18:\"支付时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1371936810.py:74: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",3:\"付款账户\",16:\"确认时间\",18:\"支付时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1371936810.py:74: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",3:\"付款账户\",16:\"确认时间\",18:\"支付时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1371936810.py:74: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",3:\"付款账户\",16:\"确认时间\",18:\"支付时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1371936810.py:74: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",3:\"付款账户\",16:\"确认时间\",18:\"支付时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1371936810.py:74: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",3:\"付款账户\",16:\"确认时间\",18:\"支付时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1371936810.py:74: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",3:\"付款账户\",16:\"确认时间\",18:\"支付时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1371936810.py:74: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",3:\"付款账户\",16:\"确认时间\",18:\"支付时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1371936810.py:74: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",3:\"付款账户\",16:\"确认时间\",18:\"支付时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1371936810.py:74: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",3:\"付款账户\",16:\"确认时间\",18:\"支付时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1371936810.py:74: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",3:\"付款账户\",16:\"确认时间\",18:\"支付时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1371936810.py:74: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",3:\"付款账户\",16:\"确认时间\",18:\"支付时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1371936810.py:74: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",3:\"付款账户\",16:\"确认时间\",18:\"支付时间\"},inplace=True)\n" ] } ], "source": [ "import re\n", "import pandas as pd\n", "\n", "def payment_handle(x):\n", " \"\"\"\n", " 处理支付信息字符串,提取支付明细和总额\n", " \n", " 示例输入: \"支付平台 支付流水 支付金额 支付手续费 Airwallex 0087ca62 GBP2845.40 GBP0.52\"\n", " \"\"\"\n", " if not x or len(x.split()) <= 4: # 处理空值或无效数据\n", " return [], 0, 0\n", " \n", " # 分割字符串并跳过前4个标题字段\n", " parts = x.split()[4:] \n", " num_records = len(parts) // 4 # 计算完整记录数\n", " records = []\n", " total_amount = 0.0\n", " total_commission = 0.0\n", " \n", " for i in range(num_records):\n", " start_idx = i * 4\n", " # 提取四个字段\n", " platform = parts[start_idx]\n", " serial = parts[start_idx + 1]\n", " amount_str = parts[start_idx + 2]\n", " commission_str = parts[start_idx + 3]\n", " \n", " # 使用正则提取金额数字和币种\n", " amount_match = re.search(r'([A-Z]+)?(\\d+\\.?\\d*)', amount_str)\n", " commission_match = re.search(r'(\\d+\\.?\\d*)', commission_str)\n", " \n", " # 解析金额数值\n", " amount_val = float(amount_match.group(2)) if amount_match else 0.0\n", " commission_val = float(commission_match.group(1)) if commission_match else 0.0\n", " currency = amount_match.group(1) if amount_match else 'UNKNOWN'\n", " \n", " # 累加总额\n", " total_amount += amount_val\n", " total_commission += commission_val\n", " \n", " # 构建记录\n", " records.append({\n", " '支付平台': platform,\n", " '支付流水': serial,\n", " '支付金额': amount_val,\n", " '支付手续费': commission_val,\n", " '币种': currency\n", " })\n", " \n", " return records, total_amount, total_commission,currency\n", "\n", "# 示例用法\n", "tail_df = pd.DataFrame(columns=['物流结算号','付款账户','确认时间',\"支付时间\",\"支付平台信息\",\"支付总金额\",\"支付总手续费\",\"币种\"])\n", "\n", "for temp_df in tail_result:\n", " if len(temp_df) < 3 or temp_df[0][2] == \"没有记录\": # 跳过空DataFrame\n", " continue\n", " \n", " subtail_df = temp_df.iloc[2:].copy() # 跳过前三行标题\n", " subtail_df[0] =subtail_df[0].str.extract(r'(\\d+)').astype(float)\n", " # 应用处理函数\n", " try:\n", " subtail_df[[\"支付平台信息\",\"支付总金额\",\"支付总手续费\",\"币种\"]] = subtail_df[19].apply(\n", " lambda x: pd.Series(payment_handle(x))\n", " )\n", " except:\n", " print(\"处理支付信息出错\")\n", " print(subtail_df[19].apply(\n", " lambda x: pd.Series(payment_handle(x))\n", " ))\n", " \n", " # 选择需要的列\n", " result_df = subtail_df[[0,3,16,18,19,\"支付平台信息\",\"支付总金额\",\"支付总手续费\",\"币种\"]]\n", " result_df.rename(columns={0:\"物流结算号\",3:\"付款账户\",16:\"确认时间\",18:\"支付时间\"},inplace=True)\n", " tail_df = pd.concat([tail_df, result_df], axis=0)\n", " tail_df = tail_df.drop_duplicates(subset=[\"物流结算号\"],keep=\"last\")\n", " tail_df.to_clipboard()\n" ] }, { "cell_type": "code", "execution_count": 67, "id": "8b00ec4a", "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\3213097610.py:7: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", " tail_flow_df = pd.concat([temp_df,tail_flow_df])\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\3213097610.py:8: FutureWarning: The provided callable is currently using SeriesGroupBy.sum. In a future version of pandas, the provided callable will be used directly. To keep current behavior pass the string \"sum\" instead.\n", " tail_flow_df_g = tail_flow_df.groupby(['流水号','平台',\"币种\"]).agg({'金额':sum,'手续费':sum}).reset_index()\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\3213097610.py:8: FutureWarning: The provided callable is currently using SeriesGroupBy.sum. In a future version of pandas, the provided callable will be used directly. To keep current behavior pass the string \"sum\" instead.\n", " tail_flow_df_g = tail_flow_df.groupby(['流水号','平台',\"币种\"]).agg({'金额':sum,'手续费':sum}).reset_index()\n" ] } ], "source": [ "tail_flow_df = pd.DataFrame(columns=['流水号','平台',\"金额\",\"手续费\",\"币种\"])\n", "for idx, row in tail_df.iterrows():\n", " if isinstance(row[\"支付平台信息\"],list)==False:\n", " continue\n", " for i in row[\"支付平台信息\"]:\n", " temp_df = pd.DataFrame({'流水号':i['支付流水'],'平台':i['支付平台'],\"金额\":i['支付金额'],\"手续费\":float(i['支付手续费']),\"币种\":i[\"币种\"]},index=[0])\n", " tail_flow_df = pd.concat([temp_df,tail_flow_df])\n", "tail_flow_df_g = tail_flow_df.groupby(['流水号','平台',\"币种\"]).agg({'金额':sum,'手续费':sum}).reset_index()" ] }, { "cell_type": "code", "execution_count": 68, "id": "66ed7c31", "metadata": {}, "outputs": [], "source": [ "tail_flow_df_g.to_clipboard()" ] }, { "cell_type": "code", "execution_count": 69, "id": "765fc32c", "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\4018039065.py:9: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n" ] } ], "source": [ "head_result = []\n", "\n", "for idx,row in capital_flow_df_g.iterrows():\n", " if row[\"流水号\"] == \"--\":\n", " continue \n", " url = \"https://cp.maso.hk/index.php?main=bol&navlist=finance_record_settle&s_payment_serial_number=%s\"% row[\"流水号\"]\n", " response = requests.get(url,headers=header)\n", " text = response.text\n", " dfs = pd.read_html(text)\n", " head_result.append(dfs[2])" ] }, { "cell_type": "code", "execution_count": 71, "id": "740caee1", "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\975717243.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",4:\"付款账户\",5:\"结算时间\",12:\"确认结算时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\975717243.py:72: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", " head_df = pd.concat([head_df, result_df], axis=0)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\975717243.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",4:\"付款账户\",5:\"结算时间\",12:\"确认结算时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\975717243.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",4:\"付款账户\",5:\"结算时间\",12:\"确认结算时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\975717243.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",4:\"付款账户\",5:\"结算时间\",12:\"确认结算时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\975717243.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",4:\"付款账户\",5:\"结算时间\",12:\"确认结算时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\975717243.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",4:\"付款账户\",5:\"结算时间\",12:\"确认结算时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\975717243.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",4:\"付款账户\",5:\"结算时间\",12:\"确认结算时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\975717243.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",4:\"付款账户\",5:\"结算时间\",12:\"确认结算时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\975717243.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",4:\"付款账户\",5:\"结算时间\",12:\"确认结算时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\975717243.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",4:\"付款账户\",5:\"结算时间\",12:\"确认结算时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\975717243.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",4:\"付款账户\",5:\"结算时间\",12:\"确认结算时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\975717243.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",4:\"付款账户\",5:\"结算时间\",12:\"确认结算时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\975717243.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",4:\"付款账户\",5:\"结算时间\",12:\"确认结算时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\975717243.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",4:\"付款账户\",5:\"结算时间\",12:\"确认结算时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\975717243.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",4:\"付款账户\",5:\"结算时间\",12:\"确认结算时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\975717243.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",4:\"付款账户\",5:\"结算时间\",12:\"确认结算时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\975717243.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",4:\"付款账户\",5:\"结算时间\",12:\"确认结算时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\975717243.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",4:\"付款账户\",5:\"结算时间\",12:\"确认结算时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\975717243.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",4:\"付款账户\",5:\"结算时间\",12:\"确认结算时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\975717243.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",4:\"付款账户\",5:\"结算时间\",12:\"确认结算时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\975717243.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",4:\"付款账户\",5:\"结算时间\",12:\"确认结算时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\975717243.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",4:\"付款账户\",5:\"结算时间\",12:\"确认结算时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\975717243.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",4:\"付款账户\",5:\"结算时间\",12:\"确认结算时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\975717243.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",4:\"付款账户\",5:\"结算时间\",12:\"确认结算时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\975717243.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",4:\"付款账户\",5:\"结算时间\",12:\"确认结算时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\975717243.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",4:\"付款账户\",5:\"结算时间\",12:\"确认结算时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\975717243.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",4:\"付款账户\",5:\"结算时间\",12:\"确认结算时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\975717243.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",4:\"付款账户\",5:\"结算时间\",12:\"确认结算时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\975717243.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",4:\"付款账户\",5:\"结算时间\",12:\"确认结算时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\975717243.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",4:\"付款账户\",5:\"结算时间\",12:\"确认结算时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\975717243.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",4:\"付款账户\",5:\"结算时间\",12:\"确认结算时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\975717243.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",4:\"付款账户\",5:\"结算时间\",12:\"确认结算时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\975717243.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",4:\"付款账户\",5:\"结算时间\",12:\"确认结算时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\975717243.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",4:\"付款账户\",5:\"结算时间\",12:\"确认结算时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\975717243.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",4:\"付款账户\",5:\"结算时间\",12:\"确认结算时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\975717243.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",4:\"付款账户\",5:\"结算时间\",12:\"确认结算时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\975717243.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",4:\"付款账户\",5:\"结算时间\",12:\"确认结算时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\975717243.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",4:\"付款账户\",5:\"结算时间\",12:\"确认结算时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\975717243.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",4:\"付款账户\",5:\"结算时间\",12:\"确认结算时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\975717243.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",4:\"付款账户\",5:\"结算时间\",12:\"确认结算时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\975717243.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",4:\"付款账户\",5:\"结算时间\",12:\"确认结算时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\975717243.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",4:\"付款账户\",5:\"结算时间\",12:\"确认结算时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\975717243.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",4:\"付款账户\",5:\"结算时间\",12:\"确认结算时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\975717243.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",4:\"付款账户\",5:\"结算时间\",12:\"确认结算时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\975717243.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",4:\"付款账户\",5:\"结算时间\",12:\"确认结算时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\975717243.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",4:\"付款账户\",5:\"结算时间\",12:\"确认结算时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\975717243.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",4:\"付款账户\",5:\"结算时间\",12:\"确认结算时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\975717243.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",4:\"付款账户\",5:\"结算时间\",12:\"确认结算时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\975717243.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",4:\"付款账户\",5:\"结算时间\",12:\"确认结算时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\975717243.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",4:\"付款账户\",5:\"结算时间\",12:\"确认结算时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\975717243.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",4:\"付款账户\",5:\"结算时间\",12:\"确认结算时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\975717243.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",4:\"付款账户\",5:\"结算时间\",12:\"确认结算时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\975717243.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",4:\"付款账户\",5:\"结算时间\",12:\"确认结算时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\975717243.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",4:\"付款账户\",5:\"结算时间\",12:\"确认结算时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\975717243.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",4:\"付款账户\",5:\"结算时间\",12:\"确认结算时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\975717243.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",4:\"付款账户\",5:\"结算时间\",12:\"确认结算时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\975717243.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",4:\"付款账户\",5:\"结算时间\",12:\"确认结算时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\975717243.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",4:\"付款账户\",5:\"结算时间\",12:\"确认结算时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\975717243.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",4:\"付款账户\",5:\"结算时间\",12:\"确认结算时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\975717243.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",4:\"付款账户\",5:\"结算时间\",12:\"确认结算时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\975717243.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",4:\"付款账户\",5:\"结算时间\",12:\"确认结算时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\975717243.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",4:\"付款账户\",5:\"结算时间\",12:\"确认结算时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\975717243.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",4:\"付款账户\",5:\"结算时间\",12:\"确认结算时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\975717243.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",4:\"付款账户\",5:\"结算时间\",12:\"确认结算时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\975717243.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",4:\"付款账户\",5:\"结算时间\",12:\"确认结算时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\975717243.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",4:\"付款账户\",5:\"结算时间\",12:\"确认结算时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\975717243.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",4:\"付款账户\",5:\"结算时间\",12:\"确认结算时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\975717243.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",4:\"付款账户\",5:\"结算时间\",12:\"确认结算时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\975717243.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",4:\"付款账户\",5:\"结算时间\",12:\"确认结算时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\975717243.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",4:\"付款账户\",5:\"结算时间\",12:\"确认结算时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\975717243.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",4:\"付款账户\",5:\"结算时间\",12:\"确认结算时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\975717243.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",4:\"付款账户\",5:\"结算时间\",12:\"确认结算时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\975717243.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",4:\"付款账户\",5:\"结算时间\",12:\"确认结算时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\975717243.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",4:\"付款账户\",5:\"结算时间\",12:\"确认结算时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\975717243.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",4:\"付款账户\",5:\"结算时间\",12:\"确认结算时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\975717243.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",4:\"付款账户\",5:\"结算时间\",12:\"确认结算时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\975717243.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",4:\"付款账户\",5:\"结算时间\",12:\"确认结算时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\975717243.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",4:\"付款账户\",5:\"结算时间\",12:\"确认结算时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\975717243.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",4:\"付款账户\",5:\"结算时间\",12:\"确认结算时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\975717243.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",4:\"付款账户\",5:\"结算时间\",12:\"确认结算时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\975717243.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",4:\"付款账户\",5:\"结算时间\",12:\"确认结算时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\975717243.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",4:\"付款账户\",5:\"结算时间\",12:\"确认结算时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\975717243.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",4:\"付款账户\",5:\"结算时间\",12:\"确认结算时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\975717243.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",4:\"付款账户\",5:\"结算时间\",12:\"确认结算时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\975717243.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",4:\"付款账户\",5:\"结算时间\",12:\"确认结算时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\975717243.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",4:\"付款账户\",5:\"结算时间\",12:\"确认结算时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\975717243.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",4:\"付款账户\",5:\"结算时间\",12:\"确认结算时间\"},inplace=True)\n" ] } ], "source": [ "def payment_handle(x):\n", " \"\"\"\n", " 处理支付信息字符串,提取支付明细和总额\n", " \n", " 示例输入: \"支付平台 支付流水 支付金额 支付手续费 Airwallex 0087ca62 GBP2845.40 GBP0.52\"\n", " \"\"\"\n", " if not x or len(x.split()) <= 4: # 处理空值或无效数据\n", " return [], 0, 0\n", " \n", " # 分割字符串并跳过前4个标题字段\n", " parts = x.split()[4:] \n", " num_records = len(parts) // 4 # 计算完整记录数\n", " records = []\n", " total_amount = 0.0\n", " total_commission = 0.0\n", " \n", " for i in range(num_records):\n", " start_idx = i * 4\n", " # 提取四个字段\n", " platform = parts[start_idx]\n", " serial = parts[start_idx + 1]\n", " amount_str = parts[start_idx + 2]\n", " commission_str = parts[start_idx + 3]\n", " \n", " # 使用正则提取金额数字和币种\n", " amount_match = re.search(r'([A-Z]+)?(\\d+\\.?\\d*)', amount_str)\n", " commission_match = re.search(r'(\\d+\\.?\\d*)', commission_str)\n", " \n", " # 解析金额数值\n", " amount_val = float(amount_match.group(2)) if amount_match else 0.0\n", " commission_val = float(commission_match.group(1)) if commission_match else 0.0\n", " currency = amount_match.group(1) if amount_match else 'UNKNOWN'\n", " \n", " # 累加总额\n", " total_amount += amount_val\n", " total_commission += commission_val\n", " \n", " # 构建记录\n", " records.append({\n", " '支付平台': platform,\n", " '支付流水': serial,\n", " '支付金额': amount_val,\n", " '支付手续费': commission_val,\n", " '币种': currency\n", " })\n", " \n", " return records, total_amount, total_commission,currency\n", "\n", "# 示例用法\n", "head_df = pd.DataFrame(columns=['结算号','付款账户','结算时间',\"确认结算时间\",\"支付平台信息\",\"支付总金额\",\"支付总手续费\",\"币种\"])\n", "\n", "for temp_df in head_result:\n", " if len(temp_df) < 2 or temp_df[1][1] == \"无记录\": # 跳过空DataFrame\n", " continue\n", " \n", " subtail_df = temp_df.iloc[1:].copy() # 跳过前三行标题\n", " subtail_df[0] =subtail_df[0].str.extract(r'(\\d+)').astype(float)\n", " # 应用处理函数\n", " try:\n", " subtail_df[[\"支付平台信息\",\"支付总金额\",\"支付总手续费\",\"币种\"]] = subtail_df[17].apply(\n", " lambda x: pd.Series(payment_handle(x))\n", " )\n", " except:\n", " print(\"处理支付信息出错\")\n", " print(subtail_df[17].apply(\n", " lambda x: pd.Series(payment_handle(x))\n", " ))\n", " \n", " # 选择需要的列\n", " result_df = subtail_df[[0,3,5,12,17,\"支付平台信息\",\"支付总金额\",\"支付总手续费\",\"币种\"]]\n", " result_df.rename(columns={0:\"物流结算号\",4:\"付款账户\",5:\"结算时间\",12:\"确认结算时间\"},inplace=True)\n", " head_df = pd.concat([head_df, result_df], axis=0)\n", " head_df = head_df.drop_duplicates(subset=[\"物流结算号\"],keep=\"last\")\n", " head_df.to_clipboard()\n" ] }, { "cell_type": "code", "execution_count": 73, "id": "4824e20b", "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1693534846.py:7: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", " head_flow_df = pd.concat([temp_df,head_flow_df])\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1693534846.py:8: FutureWarning: The provided callable is currently using SeriesGroupBy.sum. In a future version of pandas, the provided callable will be used directly. To keep current behavior pass the string \"sum\" instead.\n", " head_flow_df_g = head_flow_df.groupby(['流水号','平台','币种']).agg({'金额':sum,'手续费':sum}).reset_index()\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1693534846.py:8: FutureWarning: The provided callable is currently using SeriesGroupBy.sum. In a future version of pandas, the provided callable will be used directly. To keep current behavior pass the string \"sum\" instead.\n", " head_flow_df_g = head_flow_df.groupby(['流水号','平台','币种']).agg({'金额':sum,'手续费':sum}).reset_index()\n" ] } ], "source": [ "head_flow_df = pd.DataFrame(columns=['流水号','平台',\"金额\",\"手续费\"])\n", "for idx, row in head_df.iterrows():\n", " if isinstance(row[\"支付平台信息\"],list)==False:\n", " continue\n", " for i in row[\"支付平台信息\"]:\n", " temp_df = pd.DataFrame({'流水号':i['支付流水'],'平台':i['支付平台'],\"金额\":i['支付金额'],\"手续费\":float(i['支付手续费']),\"币种\":i['币种']},index=[0])\n", " head_flow_df = pd.concat([temp_df,head_flow_df])\n", "head_flow_df_g = head_flow_df.groupby(['流水号','平台','币种']).agg({'金额':sum,'手续费':sum}).reset_index()\n", "head_flow_df_g.to_clipboard()" ] }, { "cell_type": "code", "execution_count": 74, "id": "1c42c1e7", "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1641200776.py:8: FutureWarning: Passing literal html to 'read_html' is deprecated and will be removed in a future version. To read from a literal string, wrap it in a 'StringIO' object.\n", " dfs = pd.read_html(text)\n" ] } ], "source": [ "expend_result = []\n", "for idx,row in capital_flow_df_g.iterrows():\n", " if row[\"流水号\"] == \"--\":\n", " continue \n", " url = \"https://cp.maso.hk/index.php?main=odr_cost&navlist=expend_batch&s_payment_serial_number=%s\"% row[\"流水号\"]\n", " response = requests.get(url,headers=header)\n", " text = response.text\n", " dfs = pd.read_html(text)\n", " expend_result.append(dfs[1])" ] }, { "cell_type": "code", "execution_count": 75, "id": "7961397d", "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1571627553.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",3:\"付款账户\",4:\"支付金额\",7:\"添加时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1571627553.py:72: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", " expend_df = pd.concat([expend_df, result_df], axis=0)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1571627553.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",3:\"付款账户\",4:\"支付金额\",7:\"添加时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1571627553.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",3:\"付款账户\",4:\"支付金额\",7:\"添加时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1571627553.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",3:\"付款账户\",4:\"支付金额\",7:\"添加时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1571627553.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",3:\"付款账户\",4:\"支付金额\",7:\"添加时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1571627553.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",3:\"付款账户\",4:\"支付金额\",7:\"添加时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1571627553.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",3:\"付款账户\",4:\"支付金额\",7:\"添加时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1571627553.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",3:\"付款账户\",4:\"支付金额\",7:\"添加时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1571627553.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",3:\"付款账户\",4:\"支付金额\",7:\"添加时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1571627553.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",3:\"付款账户\",4:\"支付金额\",7:\"添加时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1571627553.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",3:\"付款账户\",4:\"支付金额\",7:\"添加时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1571627553.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",3:\"付款账户\",4:\"支付金额\",7:\"添加时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1571627553.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",3:\"付款账户\",4:\"支付金额\",7:\"添加时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1571627553.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",3:\"付款账户\",4:\"支付金额\",7:\"添加时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1571627553.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",3:\"付款账户\",4:\"支付金额\",7:\"添加时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1571627553.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",3:\"付款账户\",4:\"支付金额\",7:\"添加时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1571627553.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",3:\"付款账户\",4:\"支付金额\",7:\"添加时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1571627553.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",3:\"付款账户\",4:\"支付金额\",7:\"添加时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1571627553.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",3:\"付款账户\",4:\"支付金额\",7:\"添加时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1571627553.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",3:\"付款账户\",4:\"支付金额\",7:\"添加时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1571627553.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",3:\"付款账户\",4:\"支付金额\",7:\"添加时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1571627553.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",3:\"付款账户\",4:\"支付金额\",7:\"添加时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1571627553.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",3:\"付款账户\",4:\"支付金额\",7:\"添加时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1571627553.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",3:\"付款账户\",4:\"支付金额\",7:\"添加时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1571627553.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",3:\"付款账户\",4:\"支付金额\",7:\"添加时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1571627553.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",3:\"付款账户\",4:\"支付金额\",7:\"添加时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1571627553.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",3:\"付款账户\",4:\"支付金额\",7:\"添加时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1571627553.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",3:\"付款账户\",4:\"支付金额\",7:\"添加时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1571627553.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",3:\"付款账户\",4:\"支付金额\",7:\"添加时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1571627553.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",3:\"付款账户\",4:\"支付金额\",7:\"添加时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1571627553.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",3:\"付款账户\",4:\"支付金额\",7:\"添加时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1571627553.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",3:\"付款账户\",4:\"支付金额\",7:\"添加时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1571627553.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",3:\"付款账户\",4:\"支付金额\",7:\"添加时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1571627553.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",3:\"付款账户\",4:\"支付金额\",7:\"添加时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1571627553.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",3:\"付款账户\",4:\"支付金额\",7:\"添加时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1571627553.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",3:\"付款账户\",4:\"支付金额\",7:\"添加时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1571627553.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",3:\"付款账户\",4:\"支付金额\",7:\"添加时间\"},inplace=True)\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\1571627553.py:71: SettingWithCopyWarning: \n", "A value is trying to be set on a copy of a slice from a DataFrame\n", "\n", "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", " result_df.rename(columns={0:\"物流结算号\",3:\"付款账户\",4:\"支付金额\",7:\"添加时间\"},inplace=True)\n" ] } ], "source": [ "def payment_handle(x):\n", " \"\"\"\n", " 处理支付信息字符串,提取支付明细和总额\n", " \n", " 示例输入: \"支付平台 支付流水 支付金额 支付手续费 Airwallex 0087ca62 GBP2845.40 GBP0.52\"\n", " \"\"\"\n", " if not x or len(x.split()) <= 4: # 处理空值或无效数据\n", " return [], 0, 0\n", " \n", " # 分割字符串并跳过前4个标题字段\n", " parts = x.split()[4:] \n", " num_records = len(parts) // 4 # 计算完整记录数\n", " records = []\n", " total_amount = 0.0\n", " total_commission = 0.0\n", " \n", " for i in range(num_records):\n", " start_idx = i * 4\n", " # 提取四个字段\n", " platform = parts[start_idx]\n", " serial = parts[start_idx + 1]\n", " amount_str = parts[start_idx + 2]\n", " commission_str = parts[start_idx + 3]\n", " \n", " # 使用正则提取金额数字和币种\n", " amount_match = re.search(r'([A-Z]+)?(\\d+\\.?\\d*)', amount_str)\n", " commission_match = re.search(r'(\\d+\\.?\\d*)', commission_str)\n", " \n", " # 解析金额数值\n", " amount_val = float(amount_match.group(2)) if amount_match else 0.0\n", " commission_val = float(commission_match.group(1)) if commission_match else 0.0\n", " currency = amount_match.group(1) if amount_match else 'UNKNOWN'\n", " \n", " # 累加总额\n", " total_amount += amount_val\n", " total_commission += commission_val\n", " \n", " # 构建记录\n", " records.append({\n", " '支付平台': platform,\n", " '支付流水': serial,\n", " '支付金额': amount_val,\n", " '支付手续费': commission_val,\n", " '币种': currency\n", " })\n", " \n", " return records, total_amount, total_commission,currency\n", "\n", "# 示例用法\n", "expend_df = pd.DataFrame(columns=['结算号','付款账户','结算时间',\"确认结算时间\",\"支付平台信息\",\"支付总金额\",\"支付总手续费\",\"币种\"])\n", "\n", "for temp_df in expend_result:\n", " if len(temp_df) < 2 or temp_df[1][1] == \"无记录\": # 跳过空DataFrame\n", " continue\n", " \n", " subtail_df = temp_df.iloc[1:].copy() # 跳过前三行标题\n", " subtail_df[0] =subtail_df[0].str.extract(r'(\\d+)').astype(float)\n", " # 应用处理函数\n", " try:\n", " subtail_df[[\"支付平台信息\",\"支付总金额\",\"支付总手续费\",\"币种\"]] = subtail_df[13].apply(\n", " lambda x: pd.Series(payment_handle(x))\n", " )\n", " except:\n", " print(\"处理支付信息出错\")\n", " print(subtail_df[17].apply(\n", " lambda x: pd.Series(payment_handle(x))\n", " ))\n", " \n", " # 选择需要的列\n", " result_df = subtail_df[[0,3,4,7,17,\"支付平台信息\",\"支付总金额\",\"支付总手续费\",\"币种\"]]\n", " result_df.rename(columns={0:\"物流结算号\",3:\"付款账户\",4:\"支付金额\",7:\"添加时间\"},inplace=True)\n", " expend_df = pd.concat([expend_df, result_df], axis=0)\n", " expend_df = expend_df.drop_duplicates(subset=[\"物流结算号\"],keep=\"last\")\n", " expend_df.to_clipboard()\n" ] }, { "cell_type": "code", "execution_count": 77, "id": "3aecc618", "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\2501565041.py:7: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.\n", " expend_df_flow = pd.concat([temp_df,expend_df_flow])\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\2501565041.py:8: FutureWarning: The provided callable is currently using SeriesGroupBy.sum. In a future version of pandas, the provided callable will be used directly. To keep current behavior pass the string \"sum\" instead.\n", " expend_df_flow_g = expend_df_flow.groupby(['流水号','平台','币种']).agg({'金额':sum,'手续费':sum}).reset_index()\n", "C:\\Users\\joker\\AppData\\Local\\Temp\\ipykernel_46936\\2501565041.py:8: FutureWarning: The provided callable is currently using SeriesGroupBy.sum. In a future version of pandas, the provided callable will be used directly. To keep current behavior pass the string \"sum\" instead.\n", " expend_df_flow_g = expend_df_flow.groupby(['流水号','平台','币种']).agg({'金额':sum,'手续费':sum}).reset_index()\n" ] } ], "source": [ "expend_df_flow = pd.DataFrame(columns=['流水号','平台',\"金额\",\"手续费\"])\n", "for idx, row in expend_df.iterrows():\n", " if isinstance(row[\"支付平台信息\"],list)==False:\n", " continue\n", " for i in row[\"支付平台信息\"]:\n", " temp_df = pd.DataFrame({'流水号':i['支付流水'],'平台':i['支付平台'],\"金额\":i['支付金额'],\"手续费\":float(i['支付手续费']),\"币种\":i['币种']},index=[0])\n", " expend_df_flow = pd.concat([temp_df,expend_df_flow])\n", "expend_df_flow_g = expend_df_flow.groupby(['流水号','平台','币种']).agg({'金额':sum,'手续费':sum}).reset_index()\n", "expend_df_flow_g.to_clipboard()" ] }, { "cell_type": "code", "execution_count": null, "id": "3406159e", "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "base", "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.12.7" } }, "nbformat": 4, "nbformat_minor": 5 }