{"id":1179862,"date":"2025-01-15T18:29:39","date_gmt":"2025-01-15T10:29:39","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1179862.html"},"modified":"2025-01-15T18:29:42","modified_gmt":"2025-01-15T10:29:42","slug":"python%e5%a6%82%e4%bd%95%e8%ae%a1%e7%ae%97%e8%82%a1%e7%a5%a8%e6%8c%81%e4%bb%93%e6%97%b6%e9%97%b4","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1179862.html","title":{"rendered":"python\u5982\u4f55\u8ba1\u7b97\u80a1\u7968\u6301\u4ed3\u65f6\u95f4"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25114152\/e6f55bc8-4a73-4f67-89fc-47892062b5b6.webp\" alt=\"python\u5982\u4f55\u8ba1\u7b97\u80a1\u7968\u6301\u4ed3\u65f6\u95f4\" \/><\/p>\n<p><p> <strong>Python\u8ba1\u7b97\u80a1\u7968\u6301\u4ed3\u65f6\u95f4\u7684\u65b9\u6cd5\u6709\u591a\u79cd\uff0c\u5e38\u7528\u7684\u65b9\u6cd5\u5305\u62ec\uff1a\u901a\u8fc7\u4ea4\u6613\u6570\u636e\u8ba1\u7b97\u3001\u4f7f\u7528Python\u5e93\u5982Pandas\u8fdb\u884c\u6570\u636e\u5904\u7406\u3001\u4ee5\u53ca\u7ed3\u5408\u65e5\u671f\u65f6\u95f4\u6a21\u5757\u5904\u7406\u65f6\u95f4\u6570\u636e\u3002<\/strong> \u5176\u4e2d\uff0c\u5229\u7528Pandas\u5e93\u5904\u7406\u4ea4\u6613\u6570\u636e\u662f\u6700\u5e38\u7528\u4e14\u9ad8\u6548\u7684\u65b9\u6cd5\uff0c\u56e0\u4e3aPandas\u80fd\u591f\u975e\u5e38\u65b9\u4fbf\u5730\u5904\u7406\u548c\u5206\u6790\u65f6\u95f4\u5e8f\u5217\u6570\u636e\u3002\u4ee5\u4e0b\u662f\u8be6\u7ec6\u4ecb\u7ecd\uff1a<\/p>\n<\/p>\n<p><h3>\u4e00\u3001\u901a\u8fc7\u4ea4\u6613\u6570\u636e\u8ba1\u7b97<\/h3>\n<\/p>\n<p><p>\u901a\u8fc7\u8bfb\u53d6\u4ea4\u6613\u6570\u636e\uff0c\u53ef\u4ee5\u8ba1\u7b97\u6301\u4ed3\u7684\u5f00\u59cb\u548c\u7ed3\u675f\u65f6\u95f4\uff0c\u5e76\u8fdb\u800c\u8ba1\u7b97\u6301\u4ed3\u65f6\u95f4\u3002\u5047\u8bbe\u6211\u4eec\u6709\u4e00\u4e2a\u5305\u542b\u4ea4\u6613\u8bb0\u5f55\u7684CSV\u6587\u4ef6\uff0c\u5176\u4e2d\u5305\u62ec\u4ea4\u6613\u65e5\u671f\u3001\u4e70\u5356\u7c7b\u578b\u3001\u80a1\u7968\u4ee3\u7801\u7b49\u4fe1\u606f\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import pandas as pd<\/p>\n<h2><strong>\u8bfb\u53d6\u4ea4\u6613\u6570\u636e<\/strong><\/h2>\n<p>data = pd.read_csv(&#39;trading_data.csv&#39;)<\/p>\n<h2><strong>\u7b5b\u9009\u51fa\u4e70\u5165\u8bb0\u5f55<\/strong><\/h2>\n<p>buy_data = data[data[&#39;type&#39;] == &#39;buy&#39;]<\/p>\n<h2><strong>\u7b5b\u9009\u51fa\u5356\u51fa\u8bb0\u5f55<\/strong><\/h2>\n<p>sell_data = data[data[&#39;type&#39;] == &#39;sell&#39;]<\/p>\n<h2><strong>\u5408\u5e76\u4e70\u5165\u548c\u5356\u51fa\u8bb0\u5f55\uff0c\u8ba1\u7b97\u6301\u4ed3\u65f6\u95f4<\/strong><\/h2>\n<p>holding_periods = pd.merge(buy_data, sell_data, on=&#39;stock_code&#39;, suffixes=(&#39;_buy&#39;, &#39;_sell&#39;))<\/p>\n<p>holding_periods[&#39;holding_time&#39;] = pd.to_datetime(holding_periods[&#39;date_sell&#39;]) - pd.to_datetime(holding_periods[&#39;date_buy&#39;])<\/p>\n<p>print(holding_periods[[&#39;stock_code&#39;, &#39;holding_time&#39;]])<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e8c\u3001\u4f7f\u7528Pandas\u8fdb\u884c\u6570\u636e\u5904\u7406<\/h3>\n<\/p>\n<p><p>Pandas\u63d0\u4f9b\u4e86\u4e30\u5bcc\u7684\u65f6\u95f4\u5e8f\u5217\u5904\u7406\u529f\u80fd\uff0c\u53ef\u4ee5\u7528\u6765\u65b9\u4fbf\u5730\u5904\u7406\u548c\u8ba1\u7b97\u6301\u4ed3\u65f6\u95f4\u3002<\/p>\n<\/p>\n<p><h4>1. \u8bfb\u53d6\u548c\u9884\u5904\u7406\u6570\u636e<\/h4>\n<\/p>\n<p><p>\u9996\u5148\uff0c\u8bfb\u53d6\u4ea4\u6613\u6570\u636e\uff0c\u5e76\u8fdb\u884c\u57fa\u672c\u7684\u9884\u5904\u7406\u3002\u5047\u8bbe\u6570\u636e\u5305\u542b\u4ea4\u6613\u65e5\u671f\u3001\u4ea4\u6613\u7c7b\u578b\uff08\u4e70\u5165\/\u5356\u51fa\uff09\u3001\u80a1\u7968\u4ee3\u7801\u7b49\u5b57\u6bb5\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import pandas as pd<\/p>\n<h2><strong>\u8bfb\u53d6\u4ea4\u6613\u6570\u636e<\/strong><\/h2>\n<p>df = pd.read_csv(&#39;trading_data.csv&#39;)<\/p>\n<h2><strong>\u8f6c\u6362\u4ea4\u6613\u65e5\u671f\u4e3adatetime\u7c7b\u578b<\/strong><\/h2>\n<p>df[&#39;date&#39;] = pd.to_datetime(df[&#39;date&#39;])<\/p>\n<h2><strong>\u6839\u636e\u80a1\u7968\u4ee3\u7801\u548c\u65e5\u671f\u6392\u5e8f<\/strong><\/h2>\n<p>df = df.sort_values(by=[&#39;stock_code&#39;, &#39;date&#39;])<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2. \u8ba1\u7b97\u6301\u4ed3\u65f6\u95f4<\/h4>\n<\/p>\n<p><p>\u901a\u8fc7\u5bf9\u6bcf\u53ea\u80a1\u7968\u7684\u4ea4\u6613\u8bb0\u5f55\u8fdb\u884c\u904d\u5386\uff0c\u8ba1\u7b97\u6bcf\u6b21\u4e70\u5165\u548c\u5bf9\u5e94\u7684\u5356\u51fa\u4e4b\u95f4\u7684\u6301\u4ed3\u65f6\u95f4\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">holding_times = []<\/p>\n<p>for stock_code in df[&#39;stock_code&#39;].unique():<\/p>\n<p>    stock_data = df[df[&#39;stock_code&#39;] == stock_code]<\/p>\n<p>    buy_dates = stock_data[stock_data[&#39;type&#39;] == &#39;buy&#39;][&#39;date&#39;]<\/p>\n<p>    sell_dates = stock_data[stock_data[&#39;type&#39;] == &#39;sell&#39;][&#39;date&#39;]<\/p>\n<p>    for buy_date, sell_date in zip(buy_dates, sell_dates):<\/p>\n<p>        holding_time = sell_date - buy_date<\/p>\n<p>        holding_times.append({&#39;stock_code&#39;: stock_code, &#39;holding_time&#39;: holding_time})<\/p>\n<p>holding_times_df = pd.DataFrame(holding_times)<\/p>\n<p>print(holding_times_df)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e09\u3001\u7ed3\u5408\u65e5\u671f\u65f6\u95f4\u6a21\u5757\u5904\u7406\u65f6\u95f4\u6570\u636e<\/h3>\n<\/p>\n<p><p>Python\u7684<code>datetime<\/code>\u6a21\u5757\u4e5f\u53ef\u4ee5\u7528\u6765\u5904\u7406\u548c\u8ba1\u7b97\u6301\u4ed3\u65f6\u95f4\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from datetime import datetime<\/p>\n<h2><strong>\u793a\u4f8b\u4ea4\u6613\u6570\u636e<\/strong><\/h2>\n<p>trades = [<\/p>\n<p>    {&#39;date&#39;: &#39;2023-01-01&#39;, &#39;type&#39;: &#39;buy&#39;, &#39;stock_code&#39;: &#39;AAPL&#39;},<\/p>\n<p>    {&#39;date&#39;: &#39;2023-01-15&#39;, &#39;type&#39;: &#39;sell&#39;, &#39;stock_code&#39;: &#39;AAPL&#39;},<\/p>\n<p>    {&#39;date&#39;: &#39;2023-02-01&#39;, &#39;type&#39;: &#39;buy&#39;, &#39;stock_code&#39;: &#39;GOOGL&#39;},<\/p>\n<p>    {&#39;date&#39;: &#39;2023-02-20&#39;, &#39;type&#39;: &#39;sell&#39;, &#39;stock_code&#39;: &#39;GOOGL&#39;}<\/p>\n<p>]<\/p>\n<h2><strong>\u8f6c\u6362\u65e5\u671f\u5b57\u7b26\u4e32\u4e3adatetime\u5bf9\u8c61<\/strong><\/h2>\n<p>for trade in trades:<\/p>\n<p>    trade[&#39;date&#39;] = datetime.strptime(trade[&#39;date&#39;], &#39;%Y-%m-%d&#39;)<\/p>\n<h2><strong>\u8ba1\u7b97\u6301\u4ed3\u65f6\u95f4<\/strong><\/h2>\n<p>holding_times = []<\/p>\n<p>for i in range(0, len(trades), 2):<\/p>\n<p>    buy_date = trades[i][&#39;date&#39;]<\/p>\n<p>    sell_date = trades[i+1][&#39;date&#39;]<\/p>\n<p>    holding_time = sell_date - buy_date<\/p>\n<p>    holding_times.append({&#39;stock_code&#39;: trades[i][&#39;stock_code&#39;], &#39;holding_time&#39;: holding_time})<\/p>\n<p>for ht in holding_times:<\/p>\n<p>    print(ht)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u56db\u3001\u4f18\u5316\u548c\u6269\u5c55<\/h3>\n<\/p>\n<p><p>\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0c\u53ef\u80fd\u9700\u8981\u5904\u7406\u66f4\u591a\u7684\u4ea4\u6613\u6570\u636e\uff0c\u5e76\u4e14\u9700\u8981\u66f4\u590d\u6742\u7684\u903b\u8f91\u6765\u5904\u7406\u90e8\u5206\u4e70\u5356\u5339\u914d\u7684\u95ee\u9898\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u4f18\u5316\u548c\u6269\u5c55\u7684\u5efa\u8bae\uff1a<\/p>\n<\/p>\n<p><h4>1. \u5904\u7406\u90e8\u5206\u4e70\u5356\u5339\u914d<\/h4>\n<\/p>\n<p><p>\u5728\u5b9e\u9645\u4ea4\u6613\u4e2d\uff0c\u53ef\u80fd\u4f1a\u6709\u90e8\u5206\u4e70\u5356\u5339\u914d\u7684\u60c5\u51b5\uff0c\u5373\u4e00\u6b21\u4e70\u5165\u53ef\u80fd\u5bf9\u5e94\u591a\u6b21\u5356\u51fa\uff0c\u6216\u8005\u4e00\u6b21\u5356\u51fa\u5bf9\u5e94\u591a\u6b21\u4e70\u5165\u3002\u53ef\u4ee5\u901a\u8fc7\u904d\u5386\u4ea4\u6613\u8bb0\u5f55\uff0c\u6839\u636e\u6570\u91cf\u8fdb\u884c\u90e8\u5206\u5339\u914d\u6765\u8ba1\u7b97\u6301\u4ed3\u65f6\u95f4\u3002<\/p>\n<\/p>\n<p><h4>2. \u5904\u7406\u672a\u5e73\u4ed3\u7684\u60c5\u51b5<\/h4>\n<\/p>\n<p><p>\u5728\u5b9e\u9645\u4ea4\u6613\u4e2d\uff0c\u53ef\u80fd\u4f1a\u6709\u672a\u5e73\u4ed3\u7684\u60c5\u51b5\uff0c\u5373\u4e00\u4e9b\u4e70\u5165\u4ea4\u6613\u6ca1\u6709\u5bf9\u5e94\u7684\u5356\u51fa\u4ea4\u6613\u3002\u53ef\u4ee5\u6839\u636e\u5f53\u524d\u65e5\u671f\u6765\u8ba1\u7b97\u6301\u4ed3\u65f6\u95f4\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import pandas as pd<\/p>\n<p>from datetime import datetime<\/p>\n<h2><strong>\u793a\u4f8b\u4ea4\u6613\u6570\u636e<\/strong><\/h2>\n<p>data = {<\/p>\n<p>    &#39;date&#39;: [&#39;2023-01-01&#39;, &#39;2023-01-15&#39;, &#39;2023-02-01&#39;, &#39;2023-02-20&#39;, &#39;2023-03-01&#39;],<\/p>\n<p>    &#39;type&#39;: [&#39;buy&#39;, &#39;sell&#39;, &#39;buy&#39;, &#39;sell&#39;, &#39;buy&#39;],<\/p>\n<p>    &#39;stock_code&#39;: [&#39;AAPL&#39;, &#39;AAPL&#39;, &#39;GOOGL&#39;, &#39;GOOGL&#39;, &#39;AAPL&#39;],<\/p>\n<p>    &#39;quantity&#39;: [10, 10, 5, 5, 15]<\/p>\n<p>}<\/p>\n<p>df = pd.DataFrame(data)<\/p>\n<p>df[&#39;date&#39;] = pd.to_datetime(df[&#39;date&#39;])<\/p>\n<h2><strong>\u5904\u7406\u672a\u5e73\u4ed3\u7684\u60c5\u51b5<\/strong><\/h2>\n<p>current_date = datetime.now()<\/p>\n<p>holding_times = []<\/p>\n<p>for stock_code in df[&#39;stock_code&#39;].unique():<\/p>\n<p>    stock_data = df[df[&#39;stock_code&#39;] == stock_code]<\/p>\n<p>    quantity = 0<\/p>\n<p>    buy_dates = []<\/p>\n<p>    for _, row in stock_data.iterrows():<\/p>\n<p>        if row[&#39;type&#39;] == &#39;buy&#39;:<\/p>\n<p>            quantity += row[&#39;quantity&#39;]<\/p>\n<p>            buy_dates.append(row[&#39;date&#39;])<\/p>\n<p>        elif row[&#39;type&#39;] == &#39;sell&#39;:<\/p>\n<p>            quantity -= row[&#39;quantity&#39;]<\/p>\n<p>            sell_date = row[&#39;date&#39;]<\/p>\n<p>            while row[&#39;quantity&#39;] &gt; 0:<\/p>\n<p>                buy_date = buy_dates.pop(0)<\/p>\n<p>                holding_time = sell_date - buy_date<\/p>\n<p>                holding_times.append({&#39;stock_code&#39;: stock_code, &#39;holding_time&#39;: holding_time})<\/p>\n<p>                row[&#39;quantity&#39;] -= 1<\/p>\n<p>    # \u5904\u7406\u672a\u5e73\u4ed3\u7684\u60c5\u51b5<\/p>\n<p>    while quantity &gt; 0:<\/p>\n<p>        buy_date = buy_dates.pop(0)<\/p>\n<p>        holding_time = current_date - buy_date<\/p>\n<p>        holding_times.append({&#39;stock_code&#39;: stock_code, &#39;holding_time&#39;: holding_time})<\/p>\n<p>        quantity -= 1<\/p>\n<p>holding_times_df = pd.DataFrame(holding_times)<\/p>\n<p>print(holding_times_df)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u901a\u8fc7\u4ee5\u4e0a\u65b9\u6cd5\uff0c\u6211\u4eec\u53ef\u4ee5\u5229\u7528Python\u6765\u8ba1\u7b97\u80a1\u7968\u7684\u6301\u4ed3\u65f6\u95f4\u3002<strong>Pandas\u5e93\u7684\u5f3a\u5927\u6570\u636e\u5904\u7406\u80fd\u529b\u548cPython\u7684\u65e5\u671f\u65f6\u95f4\u6a21\u5757\u7ed3\u5408\u4f7f\u7528\uff0c\u53ef\u4ee5\u6709\u6548\u5730\u5904\u7406\u548c\u8ba1\u7b97\u80a1\u7968\u4ea4\u6613\u6570\u636e\u4e2d\u7684\u6301\u4ed3\u65f6\u95f4\u3002<\/strong> \u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0c\u6839\u636e\u5177\u4f53\u9700\u6c42\uff0c\u53ef\u4ee5\u5bf9\u8fd9\u4e9b\u65b9\u6cd5\u8fdb\u884c\u8fdb\u4e00\u6b65\u7684\u4f18\u5316\u548c\u6269\u5c55\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u4f7f\u7528Python\u8ba1\u7b97\u80a1\u7968\u6301\u4ed3\u65f6\u95f4\uff1f<\/strong><br \/>\u5728Python\u4e2d\uff0c\u53ef\u4ee5\u5229\u7528datetime\u6a21\u5757\u6765\u8ba1\u7b97\u80a1\u7968\u7684\u6301\u4ed3\u65f6\u95f4\u3002\u9996\u5148\uff0c\u8bb0\u5f55\u80a1\u7968\u7684\u8d2d\u4e70\u65e5\u671f\u548c\u5f53\u524d\u65e5\u671f\uff0c\u7136\u540e\u901a\u8fc7\u76f8\u51cf\u8ba1\u7b97\u51fa\u6301\u4ed3\u5929\u6570\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u7b80\u5355\u7684\u793a\u4f8b\u4ee3\u7801\uff1a  <\/p>\n<pre><code class=\"language-python\">from datetime import datetime\n\n# \u5047\u8bbe\u8d2d\u4e70\u65e5\u671f\u4e3a2022\u5e741\u67081\u65e5\npurchase_date = datetime(2022, 1, 1)\ncurrent_date = datetime.now()\n\nholding_period = current_date - purchase_date\nprint(f&quot;\u6301\u4ed3\u65f6\u95f4\u4e3a: {holding_period.days} \u5929&quot;)\n<\/code><\/pre>\n<p><strong>\u662f\u5426\u53ef\u4ee5\u901a\u8fc7Python\u5e93\u6765\u83b7\u53d6\u80a1\u7968\u7684\u5386\u53f2\u6570\u636e\uff1f<\/strong><br \/>\u662f\u7684\uff0cPython\u6709\u8bb8\u591a\u5f3a\u5927\u7684\u5e93\u53ef\u4ee5\u83b7\u53d6\u80a1\u7968\u7684\u5386\u53f2\u6570\u636e\uff0c\u4f8b\u5982<code>pandas_datareader<\/code>\u548c<code>yfinance<\/code>\u3002\u8fd9\u4e9b\u5e93\u53ef\u4ee5\u8f7b\u677e\u83b7\u53d6\u80a1\u7968\u7684\u4ef7\u683c\u548c\u4ea4\u6613\u91cf\u7b49\u4fe1\u606f\uff0c\u5e2e\u52a9\u7528\u6237\u5206\u6790\u6301\u4ed3\u65f6\u95f4\u4e0e\u5e02\u573a\u8868\u73b0\u4e4b\u95f4\u7684\u5173\u7cfb\u3002<\/p>\n<p><strong>\u5982\u4f55\u5728\u6301\u4ed3\u65f6\u95f4\u5185\u8ba1\u7b97\u80a1\u7968\u7684\u6536\u76ca\u7387\uff1f<\/strong><br \/>\u53ef\u4ee5\u901a\u8fc7\u8bb0\u5f55\u8d2d\u4e70\u4ef7\u683c\u548c\u5f53\u524d\u4ef7\u683c\u6765\u8ba1\u7b97\u6536\u76ca\u7387\u3002\u6536\u76ca\u7387\u7684\u516c\u5f0f\u4e3a\uff1a(\u5f53\u524d\u4ef7\u683c &#8211; \u8d2d\u4e70\u4ef7\u683c) \/ \u8d2d\u4e70\u4ef7\u683c * 100%\u3002\u7ed3\u5408\u6301\u4ed3\u65f6\u95f4\uff0c\u53ef\u4ee5\u66f4\u6df1\u5165\u5730\u5206\u6790\u6295\u8d44\u8868\u73b0\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u7b80\u5355\u7684\u4ee3\u7801\u793a\u4f8b\uff1a  <\/p>\n<pre><code class=\"language-python\">purchase_price = 100  # \u5047\u8bbe\u8d2d\u4e70\u4ef7\u683c\u4e3a100\ncurrent_price = 120   # \u5047\u8bbe\u5f53\u524d\u4ef7\u683c\u4e3a120\n\nreturn_rate = (current_price - purchase_price) \/ purchase_price * 100\nprint(f&quot;\u6301\u4ed3\u671f\u95f4\u7684\u6536\u76ca\u7387\u4e3a: {return_rate:.2f}%&quot;)\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"Python\u8ba1\u7b97\u80a1\u7968\u6301\u4ed3\u65f6\u95f4\u7684\u65b9\u6cd5\u6709\u591a\u79cd\uff0c\u5e38\u7528\u7684\u65b9\u6cd5\u5305\u62ec\uff1a\u901a\u8fc7\u4ea4\u6613\u6570\u636e\u8ba1\u7b97\u3001\u4f7f\u7528Python\u5e93\u5982Pandas\u8fdb [&hellip;]","protected":false},"author":3,"featured_media":1179866,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[37],"tags":[],"acf":[],"_links":{"self":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1179862"}],"collection":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/comments?post=1179862"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1179862\/revisions"}],"predecessor-version":[{"id":1179870,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1179862\/revisions\/1179870"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1179866"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1179862"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1179862"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1179862"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}