{"id":1070232,"date":"2025-01-08T10:56:22","date_gmt":"2025-01-08T02:56:22","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1070232.html"},"modified":"2025-01-08T10:56:24","modified_gmt":"2025-01-08T02:56:24","slug":"python%e5%a6%82%e4%bd%95%e4%bd%bf%e6%96%b9%e5%b7%ae%e6%9c%80%e5%b0%8f%e8%b5%84%e4%ba%a7%e9%85%8d%e7%bd%ae-2","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1070232.html","title":{"rendered":"python\u5982\u4f55\u4f7f\u65b9\u5dee\u6700\u5c0f\u8d44\u4ea7\u914d\u7f6e"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25101022\/ccfffdaa-cd25-4e71-957d-673ab0560097.webp\" alt=\"python\u5982\u4f55\u4f7f\u65b9\u5dee\u6700\u5c0f\u8d44\u4ea7\u914d\u7f6e\" \/><\/p>\n<p><p> <strong>Python\u5982\u4f55\u4f7f\u65b9\u5dee\u6700\u5c0f\u8d44\u4ea7\u914d\u7f6e<\/strong><\/p>\n<\/p>\n<p><p>\u8981\u5728Python\u4e2d\u5b9e\u73b0\u4f7f\u65b9\u5dee\u6700\u5c0f\u7684\u8d44\u4ea7\u914d\u7f6e\uff0c\u5173\u952e\u5728\u4e8e<strong>\u4f7f\u7528\u4f18\u5316\u65b9\u6cd5\u3001\u8ba1\u7b97\u534f\u65b9\u5dee\u77e9\u9635\u3001\u7ea6\u675f\u6761\u4ef6\u8bbe\u7f6e\u3001\u6c42\u89e3\u6700\u4f18\u5316\u95ee\u9898<\/strong>\u3002\u901a\u8fc7\u8fd9\u4e9b\u6b65\u9aa4\uff0c\u80fd\u591f\u6709\u6548\u5730\u627e\u5230\u8d44\u4ea7\u7ec4\u5408\u4e2d\u4f7f\u65b9\u5dee\u6700\u5c0f\u7684\u6743\u91cd\u914d\u7f6e\u3002<strong>\u7ea6\u675f\u6761\u4ef6\u8bbe\u7f6e<\/strong>\u662f\u5176\u4e2d\u7684\u5173\u952e\u6b65\u9aa4\u4e4b\u4e00\uff0c\u56e0\u4e3a\u5b83\u786e\u4fdd\u4e86\u7ec4\u5408\u6743\u91cd\u7684\u6709\u6548\u6027\u548c\u5408\u7406\u6027\u3002\u7ea6\u675f\u6761\u4ef6\u53ef\u4ee5\u5305\u62ec\u7ec4\u5408\u6743\u91cd\u4e4b\u548c\u4e3a1\u4ee5\u53ca\u6bcf\u4e2a\u8d44\u4ea7\u6743\u91cd\u7684\u975e\u8d1f\u6027\u3002<\/p>\n<\/p>\n<p><h3>\u4e00\u3001\u4f7f\u7528\u4f18\u5316\u65b9\u6cd5<\/h3>\n<\/p>\n<p><p>\u5728\u4f18\u5316\u95ee\u9898\u4e2d\uff0c\u6211\u4eec\u901a\u5e38\u4f1a\u4f7f\u7528\u73b0\u6709\u7684\u4f18\u5316\u5e93\u6765\u7b80\u5316\u6c42\u89e3\u8fc7\u7a0b\u3002\u5728Python\u4e2d\uff0c<code>scipy.optimize<\/code>\u5e93\u662f\u4e00\u4e2a\u5f3a\u5927\u7684\u5de5\u5177\uff0c\u53ef\u4ee5\u7528\u4e8e\u89e3\u51b3\u591a\u79cd\u4f18\u5316\u95ee\u9898\u3002\u5177\u4f53\u5230\u8d44\u4ea7\u914d\u7f6e\u95ee\u9898\uff0c\u6211\u4eec\u4e3b\u8981\u4f7f\u7528\u5176\u4e2d\u7684<code>minimize<\/code>\u51fd\u6570\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import numpy as np<\/p>\n<p>from scipy.optimize import minimize<\/p>\n<h2><strong>\u5047\u8bbe\u6709n\u4e2a\u8d44\u4ea7\uff0c\u5b9a\u4e49\u4e00\u4e2a\u521d\u59cb\u6743\u91cd<\/strong><\/h2>\n<p>n = 4<\/p>\n<p>initial_weights = np.ones(n) \/ n<\/p>\n<h2><strong>\u5b9a\u4e49\u7ea6\u675f\u6761\u4ef6\u548c\u8fb9\u754c<\/strong><\/h2>\n<p>constr<a href=\"https:\/\/docs.pingcode.com\/blog\/59162.html\" target=\"_blank\">AI<\/a>nts = ({&#39;type&#39;: &#39;eq&#39;, &#39;fun&#39;: lambda x: np.sum(x) - 1})<\/p>\n<p>bounds = tuple((0, 1) for asset in range(n))<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e8c\u3001\u8ba1\u7b97\u534f\u65b9\u5dee\u77e9\u9635<\/h3>\n<\/p>\n<p><p>\u534f\u65b9\u5dee\u77e9\u9635\u662f\u63cf\u8ff0\u8d44\u4ea7\u4e4b\u95f4\u5982\u4f55\u5171\u540c\u53d8\u5316\u7684\u5173\u952e\u5de5\u5177\u3002\u901a\u8fc7\u5386\u53f2\u6570\u636e\uff0c\u6211\u4eec\u53ef\u4ee5\u8ba1\u7b97\u8d44\u4ea7\u7684\u534f\u65b9\u5dee\u77e9\u9635\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import pandas as pd<\/p>\n<h2><strong>\u8bfb\u53d6\u8d44\u4ea7\u4ef7\u683c\u6570\u636e\uff0c\u5047\u8bbe\u6570\u636e\u5df2\u7ecf\u9884\u5904\u7406\u597d<\/strong><\/h2>\n<p>data = pd.read_csv(&#39;asset_prices.csv&#39;, index_col=&#39;Date&#39;)<\/p>\n<p>returns = data.pct_change().dropna()<\/p>\n<h2><strong>\u8ba1\u7b97\u534f\u65b9\u5dee\u77e9\u9635<\/strong><\/h2>\n<p>cov_matrix = returns.cov()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e09\u3001\u7ea6\u675f\u6761\u4ef6\u8bbe\u7f6e<\/h3>\n<\/p>\n<p><p>\u5728\u8bbe\u7f6e\u7ea6\u675f\u6761\u4ef6\u65f6\uff0c\u6211\u4eec\u9700\u8981\u786e\u4fdd\u7ec4\u5408\u6743\u91cd\u7684\u548c\u4e3a1\uff0c\u5e76\u4e14\u6bcf\u4e2a\u6743\u91cd\u57280\u52301\u4e4b\u95f4\u3002\u8fd9\u53ef\u4ee5\u901a\u8fc7\u5728\u4f18\u5316\u51fd\u6570\u4e2d\u660e\u786e\u7ea6\u675f\u6761\u4ef6\u548c\u8fb9\u754c\u6765\u5b9e\u73b0\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">def portfolio_variance(weights, cov_matrix):<\/p>\n<p>    return np.dot(weights.T, np.dot(cov_matrix, weights))<\/p>\n<h2><strong>\u8c03\u7528\u4f18\u5316\u51fd\u6570<\/strong><\/h2>\n<p>result = minimize(portfolio_variance, initial_weights, args=(cov_matrix,), method=&#39;SLSQP&#39;, bounds=bounds, constraints=constraints)<\/p>\n<p>optimal_weights = result.x<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u56db\u3001\u6c42\u89e3\u6700\u4f18\u5316\u95ee\u9898<\/h3>\n<\/p>\n<p><p>\u6211\u4eec\u5c06\u4f18\u5316\u95ee\u9898\u5b9a\u4e49\u4e3a\u6700\u5c0f\u5316\u7ec4\u5408\u7684\u65b9\u5dee\uff0c\u5e76\u4f7f\u7528<code>scipy.optimize.minimize<\/code>\u51fd\u6570\u8fdb\u884c\u6c42\u89e3\u3002\u901a\u8fc7\u8bbe\u7f6e\u521d\u59cb\u6743\u91cd\u3001\u7ea6\u675f\u6761\u4ef6\u548c\u8fb9\u754c\uff0c\u6211\u4eec\u53ef\u4ee5\u627e\u5230\u4f7f\u7ec4\u5408\u65b9\u5dee\u6700\u5c0f\u7684\u6743\u91cd\u914d\u7f6e\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">print(&quot;Optimal Weights:&quot;, optimal_weights)<\/p>\n<p>print(&quot;Minimum Variance:&quot;, portfolio_variance(optimal_weights, cov_matrix))<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e94\u3001\u8fdb\u4e00\u6b65\u7ec6\u5316\u548c\u6269\u5c55<\/h3>\n<\/p>\n<p><p>\u5728\u5b9e\u8df5\u4e2d\uff0c\u8d44\u4ea7\u914d\u7f6e\u95ee\u9898\u53ef\u4ee5\u66f4\u52a0\u590d\u6742\u548c\u591a\u6837\u5316\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u5e38\u89c1\u7684\u6269\u5c55\u548c\u7ec6\u5316\u65b9\u5411\uff1a<\/p>\n<\/p>\n<p><h4>1\u3001\u52a0\u5165\u9884\u671f\u6536\u76ca<\/h4>\n<\/p>\n<p><p>\u9664\u4e86\u6700\u5c0f\u5316\u65b9\u5dee\u5916\uff0c\u6295\u8d44\u8005\u901a\u5e38\u8fd8\u4f1a\u8003\u8651\u9884\u671f\u6536\u76ca\u3002\u6211\u4eec\u53ef\u4ee5\u5c06\u9884\u671f\u6536\u76ca\u7eb3\u5165\u76ee\u6807\u51fd\u6570\uff0c\u4f7f\u7528\u590f\u666e\u6bd4\u7387\uff08Sharpe Ratio\uff09\u7b49\u6307\u6807\u8fdb\u884c\u4f18\u5316\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">def portfolio_sharpe_ratio(weights, returns, cov_matrix, risk_free_rate=0.0):<\/p>\n<p>    portfolio_return = np.sum(returns.mean() * weights) * 252<\/p>\n<p>    portfolio_std = np.sqrt(np.dot(weights.T, np.dot(cov_matrix, weights))) * np.sqrt(252)<\/p>\n<p>    return (portfolio_return - risk_free_rate) \/ portfolio_std<\/p>\n<p>result = minimize(lambda weights: -portfolio_sharpe_ratio(weights, returns, cov_matrix), initial_weights, bounds=bounds, constraints=constraints)<\/p>\n<p>optimal_weights_sharpe = result.x<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2\u3001\u8003\u8651\u4ea4\u6613\u6210\u672c\u548c\u6d41\u52a8\u6027<\/h4>\n<\/p>\n<p><p>\u5728\u5b9e\u9645\u4ea4\u6613\u4e2d\uff0c\u4ea4\u6613\u6210\u672c\u548c\u5e02\u573a\u6d41\u52a8\u6027\u4e5f\u662f\u9700\u8981\u8003\u8651\u7684\u91cd\u8981\u56e0\u7d20\u3002\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u6dfb\u52a0\u989d\u5916\u7684\u7ea6\u675f\u6761\u4ef6\u548c\u76ee\u6807\u51fd\u6570\u9879\u6765\u8003\u8651\u8fd9\u4e9b\u56e0\u7d20\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">def portfolio_variance_with_costs(weights, cov_matrix, transaction_costs):<\/p>\n<p>    variance = np.dot(weights.T, np.dot(cov_matrix, weights))<\/p>\n<p>    costs = np.sum(transaction_costs * np.abs(weights))<\/p>\n<p>    return variance + costs<\/p>\n<p>transaction_costs = np.array([0.01, 0.02, 0.01, 0.03])<\/p>\n<p>result = minimize(portfolio_variance_with_costs, initial_weights, args=(cov_matrix, transaction_costs), bounds=bounds, constraints=constraints)<\/p>\n<p>optimal_weights_with_costs = result.x<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>3\u3001\u4f7f\u7528\u5176\u4ed6\u4f18\u5316\u65b9\u6cd5<\/h4>\n<\/p>\n<p><p>\u9664\u4e86<code>scipy.optimize<\/code>\u5e93\uff0cPython\u4e2d\u8fd8\u6709\u8bb8\u591a\u5176\u4ed6\u7684\u4f18\u5316\u5e93\u53ef\u4ee5\u4f7f\u7528\uff0c\u5982<code>cvxpy<\/code>\u3001<code>pulp<\/code>\u7b49\u3002\u8fd9\u4e9b\u5e93\u63d0\u4f9b\u4e86\u66f4\u591a\u7684\u4f18\u5316\u5de5\u5177\u548c\u65b9\u6cd5\uff0c\u53ef\u4ee5\u6839\u636e\u5177\u4f53\u95ee\u9898\u9009\u62e9\u5408\u9002\u7684\u5de5\u5177\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import cvxpy as cp<\/p>\n<h2><strong>\u5b9a\u4e49\u53d8\u91cf\u548c\u95ee\u9898<\/strong><\/h2>\n<p>weights = cp.Variable(n)<\/p>\n<p>objective = cp.Minimize(cp.quad_form(weights, cov_matrix))<\/p>\n<p>constraints = [cp.sum(weights) == 1, weights &gt;= 0]<\/p>\n<p>problem = cp.Problem(objective, constraints)<\/p>\n<h2><strong>\u6c42\u89e3\u95ee\u9898<\/strong><\/h2>\n<p>problem.solve()<\/p>\n<p>optimal_weights_cvxpy = weights.value<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u516d\u3001\u603b\u7ed3<\/h3>\n<\/p>\n<p><p>\u901a\u8fc7\u4e0a\u8ff0\u6b65\u9aa4\uff0c\u6211\u4eec\u53ef\u4ee5\u5728Python\u4e2d\u5b9e\u73b0\u4f7f\u65b9\u5dee\u6700\u5c0f\u7684\u8d44\u4ea7\u914d\u7f6e\u3002\u8fd9\u4e2a\u8fc7\u7a0b\u5305\u62ec\u4f7f\u7528\u4f18\u5316\u65b9\u6cd5\u3001\u8ba1\u7b97\u534f\u65b9\u5dee\u77e9\u9635\u3001\u8bbe\u7f6e\u7ea6\u675f\u6761\u4ef6\u4ee5\u53ca\u6c42\u89e3\u6700\u4f18\u5316\u95ee\u9898\u3002\u8fdb\u4e00\u6b65\u7684\u6269\u5c55\u548c\u7ec6\u5316\u53ef\u4ee5\u5305\u62ec\u52a0\u5165\u9884\u671f\u6536\u76ca\u3001\u8003\u8651\u4ea4\u6613\u6210\u672c\u548c\u6d41\u52a8\u6027\u4ee5\u53ca\u4f7f\u7528\u5176\u4ed6\u4f18\u5316\u65b9\u6cd5\u3002\u901a\u8fc7\u8fd9\u4e9b\u6b65\u9aa4\u548c\u65b9\u6cd5\uff0c\u6295\u8d44\u8005\u53ef\u4ee5\u627e\u5230\u6700\u4f18\u7684\u8d44\u4ea7\u914d\u7f6e\uff0c\u6700\u5927\u5316\u6536\u76ca\u5e76\u6700\u5c0f\u5316\u98ce\u9669\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5728\u8d44\u4ea7\u914d\u7f6e\u4e2d\uff0c\u65b9\u5dee\u6700\u5c0f\u5316\u7684\u57fa\u672c\u6982\u5ff5\u662f\u4ec0\u4e48\uff1f<\/strong><br \/>\u65b9\u5dee\u6700\u5c0f\u5316\u662f\u4e00\u79cd\u6295\u8d44\u7ec4\u5408\u4f18\u5316\u7b56\u7565\uff0c\u65e8\u5728\u901a\u8fc7\u9009\u62e9\u4e0d\u540c\u8d44\u4ea7\u7684\u6bd4\u4f8b\uff0c\u964d\u4f4e\u6295\u8d44\u7ec4\u5408\u7684\u603b\u98ce\u9669\u3002\u65b9\u5dee\u4ee3\u8868\u4e86\u6295\u8d44\u56de\u62a5\u7387\u7684\u6ce2\u52a8\u6027\uff0c\u8f83\u4f4e\u7684\u65b9\u5dee\u610f\u5473\u7740\u66f4\u7a33\u5b9a\u7684\u56de\u62a5\u3002\u901a\u8fc7\u4f18\u5316\u8d44\u4ea7\u914d\u7f6e\uff0c\u6295\u8d44\u8005\u53ef\u4ee5\u5728\u5b9e\u73b0\u9884\u671f\u56de\u62a5\u7684\u540c\u65f6\uff0c\u51cf\u5c11\u98ce\u9669\u3002<\/p>\n<p><strong>\u5982\u4f55\u4f7f\u7528Python\u8fdb\u884c\u65b9\u5dee\u6700\u5c0f\u5316\u8d44\u4ea7\u914d\u7f6e\uff1f<\/strong><br \/>\u5728Python\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528\u5982NumPy\u548cPandas\u7b49\u5e93\u6765\u5904\u7406\u6570\u636e\uff0c\u4f7f\u7528SciPy\u5e93\u4e2d\u7684\u4f18\u5316\u5de5\u5177\u6765\u5b9e\u73b0\u65b9\u5dee\u6700\u5c0f\u5316\u3002\u9996\u5148\uff0c\u9700\u8981\u83b7\u53d6\u5386\u53f2\u8d44\u4ea7\u56de\u62a5\u7387\u6570\u636e\uff0c\u8ba1\u7b97\u8d44\u4ea7\u7684\u534f\u65b9\u5dee\u77e9\u9635\uff0c\u7136\u540e\u5b9a\u4e49\u76ee\u6807\u51fd\u6570\uff08\u6700\u5c0f\u5316\u65b9\u5dee\uff09\uff0c\u901a\u8fc7\u7ea6\u675f\u6761\u4ef6\uff08\u5982\u6295\u8d44\u603b\u989d\u4e3a1\uff09\u6765\u6c42\u89e3\u6700\u4f18\u8d44\u4ea7\u914d\u7f6e\u6bd4\u4f8b\u3002<\/p>\n<p><strong>\u4f7f\u7528\u54ea\u4e9bPython\u5e93\u53ef\u4ee5\u5e2e\u52a9\u5b9e\u73b0\u8d44\u4ea7\u914d\u7f6e\u7684\u65b9\u5dee\u6700\u5c0f\u5316\uff1f<\/strong><br \/>\u5e38\u7528\u7684Python\u5e93\u5305\u62ecNumPy\u548cPandas\u7528\u4e8e\u6570\u636e\u5904\u7406\uff0cMatplotlib\u7528\u4e8e\u53ef\u89c6\u5316\uff0cSciPy\u7528\u4e8e\u4f18\u5316\u8ba1\u7b97\u3002\u6b64\u5916\uff0c\u7279\u5b9a\u7684\u91d1\u878d\u5206\u6790\u5e93\uff0c\u5982PyPortfolioOpt\uff0c\u4e5f\u63d0\u4f9b\u4e86\u65b9\u4fbf\u7684\u5de5\u5177\u6765\u5b9e\u73b0\u8d44\u4ea7\u914d\u7f6e\u7684\u4f18\u5316\uff0c\u80fd\u591f\u5feb\u901f\u8ba1\u7b97\u6700\u4f18\u6295\u8d44\u6bd4\u4f8b\u3002<\/p>\n<p><strong>\u65b9\u5dee\u6700\u5c0f\u5316\u8d44\u4ea7\u914d\u7f6e\u7684\u5b9e\u9645\u5e94\u7528\u6709\u54ea\u4e9b\uff1f<\/strong><br \/>\u8fd9\u79cd\u65b9\u6cd5\u5e7f\u6cdb\u5e94\u7528\u4e8e\u6295\u8d44\u7ec4\u5408\u7ba1\u7406\uff0c\u5e2e\u52a9\u6295\u8d44\u8005\u5728\u4e0d\u540c\u5e02\u573a\u6761\u4ef6\u4e0b\u4fdd\u6301\u98ce\u9669\u53ef\u63a7\u3002\u673a\u6784\u6295\u8d44\u8005\u901a\u5e38\u5229\u7528\u65b9\u5dee\u6700\u5c0f\u5316\u6280\u672f\u6765\u914d\u7f6e\u517b\u8001\u91d1\u3001\u57fa\u91d1\u548c\u5176\u4ed6\u6295\u8d44\u7ec4\u5408\uff0c\u4ee5\u5b9e\u73b0\u957f\u671f\u7a33\u5065\u7684\u6295\u8d44\u56de\u62a5\u3002\u540c\u65f6\uff0c\u4e2a\u4eba\u6295\u8d44\u8005\u4e5f\u53ef\u4ee5\u8fd0\u7528\u8fd9\u4e00\u7b56\u7565\u6765\u4f18\u5316\u81ea\u5df1\u7684\u6295\u8d44\u7ec4\u5408\uff0c\u51cf\u5c11\u6f5c\u5728\u7684\u635f\u5931\u98ce\u9669\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"Python\u5982\u4f55\u4f7f\u65b9\u5dee\u6700\u5c0f\u8d44\u4ea7\u914d\u7f6e \u8981\u5728Python\u4e2d\u5b9e\u73b0\u4f7f\u65b9\u5dee\u6700\u5c0f\u7684\u8d44\u4ea7\u914d\u7f6e\uff0c\u5173\u952e\u5728\u4e8e\u4f7f\u7528\u4f18\u5316\u65b9\u6cd5\u3001\u8ba1\u7b97\u534f\u65b9 [&hellip;]","protected":false},"author":3,"featured_media":1070237,"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\/1070232"}],"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=1070232"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1070232\/revisions"}],"predecessor-version":[{"id":1070241,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1070232\/revisions\/1070241"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1070237"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1070232"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1070232"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1070232"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}