{"id":1042482,"date":"2024-12-31T12:57:51","date_gmt":"2024-12-31T04:57:51","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1042482.html"},"modified":"2024-12-31T12:57:54","modified_gmt":"2024-12-31T04:57:54","slug":"python%e5%a6%82%e4%bd%95%e5%b0%86%e7%9f%a9%e9%98%b5%e5%86%99%e5%85%a5-txt%e6%96%87%e4%bb%b6","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1042482.html","title":{"rendered":"python\u5982\u4f55\u5c06\u77e9\u9635\u5199\u5165.txt\u6587\u4ef6"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-docs.pingcode.com\/wp-content\/uploads\/2024\/12\/9db41f3f-aa22-4463-8f31-041589a564ae.webp?x-oss-process=image\/auto-orient,1\/format,webp\" alt=\"python\u5982\u4f55\u5c06\u77e9\u9635\u5199\u5165.txt\u6587\u4ef6\" \/><\/p>\n<p><p> <strong>\u4f7f\u7528Python\u5c06\u77e9\u9635\u5199\u5165.txt\u6587\u4ef6\u53ef\u4ee5\u901a\u8fc7\u591a\u79cd\u65b9\u6cd5\u5b9e\u73b0\uff0c\u4e3b\u8981\u5305\u62ec\uff1a\u4f7f\u7528\u6807\u51c6\u7684\u6587\u4ef6\u64cd\u4f5c\u3001\u4f7f\u7528NumPy\u5e93\u3001\u4f7f\u7528Pandas\u5e93\u3002<\/strong> \u5728\u8fd9\u4e09\u79cd\u65b9\u6cd5\u4e2d\uff0c\u4f7f\u7528NumPy\u5e93\u6700\u4e3a\u5e38\u89c1\u548c\u4fbf\u6377\uff0c\u5c24\u5176\u662f\u5bf9\u4e8e\u5927\u89c4\u6a21\u6570\u636e\u7684\u5904\u7406\u3002\u4e0b\u9762\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u8fd9\u4e09\u79cd\u65b9\u6cd5\uff0c\u5e76\u91cd\u70b9\u5c55\u5f00\u4ecb\u7ecd\u4f7f\u7528NumPy\u5e93\u7684\u65b9\u6cd5\u3002<\/p>\n<\/p>\n<p><h3>\u4e00\u3001\u4f7f\u7528\u6807\u51c6\u6587\u4ef6\u64cd\u4f5c<\/h3>\n<\/p>\n<p><p>Python\u7684\u6807\u51c6\u6587\u4ef6\u64cd\u4f5c\u65b9\u6cd5\u662f\u5229\u7528\u5185\u7f6e\u7684<code>open<\/code>\u51fd\u6570\u6765\u521b\u5efa\u3001\u5199\u5165\u548c\u5173\u95ed\u6587\u4ef6\u3002\u8fd9\u79cd\u65b9\u6cd5\u9002\u7528\u4e8e\u5904\u7406\u7b80\u5355\u7684\u6570\u636e\u7ed3\u6784\uff0c\u4f8b\u5982\u4e8c\u7ef4\u5217\u8868\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">def write_matrix_to_txt(matrix, filename):<\/p>\n<p>    with open(filename, &#39;w&#39;) as file:<\/p>\n<p>        for row in matrix:<\/p>\n<p>            file.write(&quot; &quot;.join(map(str, row)) + &quot;\\n&quot;)<\/p>\n<p>matrix = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]<\/p>\n<p>write_matrix_to_txt(matrix, &#39;matrix.txt&#39;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u4e0a\u8ff0\u4ee3\u7801\u4e2d\uff0c<code>open<\/code>\u51fd\u6570\u6253\u5f00\u4e00\u4e2a\u6587\u4ef6\uff0c\u5982\u679c\u6587\u4ef6\u4e0d\u5b58\u5728\u5219\u4f1a\u521b\u5efa\uff0c<code>&#39;w&#39;<\/code>\u6a21\u5f0f\u8868\u793a\u5199\u5165\u6570\u636e\u3002\u5982\u679c\u6587\u4ef6\u5df2\u7ecf\u5b58\u5728\uff0c\u5b83\u5c06\u88ab\u8986\u76d6\u3002<code>for<\/code>\u5faa\u73af\u904d\u5386\u77e9\u9635\u7684\u6bcf\u4e00\u884c\uff0c<code>map<\/code>\u51fd\u6570\u5c06\u6bcf\u4e2a\u5143\u7d20\u8f6c\u6362\u4e3a\u5b57\u7b26\u4e32\u5e76\u7528\u7a7a\u683c\u8fde\u63a5\uff0c\u6700\u540e\u5199\u5165\u6587\u4ef6\u5e76\u6362\u884c\u3002<\/p>\n<\/p>\n<p><h3>\u4e8c\u3001\u4f7f\u7528NumPy\u5e93<\/h3>\n<\/p>\n<p><p>NumPy\u662fPython\u7684\u4e00\u4e2a\u5f3a\u5927\u5e93\uff0c\u4e13\u95e8\u7528\u4e8e\u79d1\u5b66\u8ba1\u7b97\u3002\u5b83\u63d0\u4f9b\u4e86\u4e30\u5bcc\u7684\u51fd\u6570\u6765\u5904\u7406\u6570\u7ec4\u548c\u77e9\u9635\u3002\u5728\u4f7f\u7528NumPy\u65f6\uff0c\u5e38\u89c1\u7684\u65b9\u6cd5\u662f\u5229\u7528<code>numpy.savetxt<\/code>\u51fd\u6570\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import numpy as np<\/p>\n<p>def write_matrix_to_txt(matrix, filename):<\/p>\n<p>    np.savetxt(filename, matrix, fmt=&#39;%d&#39;, delimiter=&#39; &#39;)<\/p>\n<p>matrix = np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]])<\/p>\n<p>write_matrix_to_txt(matrix, &#39;matrix.txt&#39;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u4f8b\u5b50\u4e2d\uff0c\u9996\u5148\u9700\u8981\u5bfc\u5165NumPy\u5e93\uff0c\u7136\u540e\u5c06\u77e9\u9635\u8f6c\u6362\u4e3aNumPy\u6570\u7ec4\u3002<code>numpy.savetxt<\/code>\u51fd\u6570\u53ef\u4ee5\u5c06\u6570\u7ec4\u4fdd\u5b58\u4e3a\u6587\u672c\u6587\u4ef6\uff0c\u5176\u4e2d<code>fmt<\/code>\u53c2\u6570\u6307\u5b9a\u8f93\u51fa\u7684\u683c\u5f0f\uff0c<code>delimiter<\/code>\u53c2\u6570\u6307\u5b9a\u5206\u9694\u7b26\u3002<strong>\u4f7f\u7528NumPy\u5e93\u7684\u4f18\u52bf\u5728\u4e8e\u5176\u9ad8\u6548\u7684\u6570\u7ec4\u64cd\u4f5c\u548c\u7b80\u6d01\u7684\u4ee3\u7801\u3002<\/strong><\/p>\n<\/p>\n<p><h3>\u4e09\u3001\u4f7f\u7528Pandas\u5e93<\/h3>\n<\/p>\n<p><p>Pandas\u662f\u53e6\u4e00\u4e2a\u6d41\u884c\u7684Python\u5e93\uff0c\u4e3b\u8981\u7528\u4e8e\u6570\u636e\u5206\u6790\u548c\u64cd\u4f5c\u3002Pandas\u63d0\u4f9b\u4e86DataFrame\u5bf9\u8c61\uff0c\u53ef\u4ee5\u5f88\u65b9\u4fbf\u5730\u5c06\u5176\u5199\u5165\u6587\u672c\u6587\u4ef6\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import pandas as pd<\/p>\n<p>def write_matrix_to_txt(matrix, filename):<\/p>\n<p>    df = pd.DataFrame(matrix)<\/p>\n<p>    df.to_csv(filename, header=False, index=False, sep=&#39; &#39;)<\/p>\n<p>matrix = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]<\/p>\n<p>write_matrix_to_txt(matrix, &#39;matrix.txt&#39;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u4f8b\u5b50\u4e2d\uff0c\u9996\u5148\u9700\u8981\u5bfc\u5165Pandas\u5e93\uff0c\u7136\u540e\u5c06\u77e9\u9635\u8f6c\u6362\u4e3aDataFrame\u5bf9\u8c61\u3002<code>to_csv<\/code>\u65b9\u6cd5\u53ef\u4ee5\u5c06DataFrame\u4fdd\u5b58\u4e3a\u6587\u672c\u6587\u4ef6\uff0c\u5176\u4e2d<code>header=False<\/code>\u8868\u793a\u4e0d\u5199\u5165\u5217\u6807\u7b7e\uff0c<code>index=False<\/code>\u8868\u793a\u4e0d\u5199\u5165\u884c\u6807\u7b7e\uff0c<code>sep<\/code>\u53c2\u6570\u6307\u5b9a\u5206\u9694\u7b26\u3002<\/p>\n<\/p>\n<p><h3>\u56db\u3001\u8be6\u7ec6\u4ecb\u7ecd\u4f7f\u7528NumPy\u5e93\u7684\u65b9\u6cd5<\/h3>\n<\/p>\n<p><h4>1\u3001\u5b89\u88c5\u548c\u5bfc\u5165NumPy\u5e93<\/h4>\n<\/p>\n<p><p>\u9996\u5148\uff0c\u9700\u8981\u786e\u4fdd\u5b89\u88c5\u4e86NumPy\u5e93\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-sh\">pip install numpy<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u7136\u540e\u5728Python\u811a\u672c\u4e2d\u5bfc\u5165NumPy\u5e93\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import numpy as np<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2\u3001\u521b\u5efa\u548c\u64cd\u4f5cNumPy\u6570\u7ec4<\/h4>\n<\/p>\n<p><p>NumPy\u6570\u7ec4\u662fNumPy\u5e93\u7684\u6838\u5fc3\u6570\u636e\u7ed3\u6784\uff0c\u53ef\u4ee5\u65b9\u4fbf\u5730\u8fdb\u884c\u5404\u79cd\u77e9\u9635\u64cd\u4f5c\u3002\u4ee5\u4e0b\u662f\u521b\u5efa\u548c\u64cd\u4f5cNumPy\u6570\u7ec4\u7684\u4e00\u4e9b\u4f8b\u5b50\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u521b\u5efaNumPy\u6570\u7ec4<\/p>\n<p>matrix = np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]])<\/p>\n<h2><strong>\u8bbf\u95ee\u6570\u7ec4\u5143\u7d20<\/strong><\/h2>\n<p>element = matrix[0, 1]  # \u8bbf\u95ee\u7b2c\u4e00\u884c\u7b2c\u4e8c\u5217\u7684\u5143\u7d20<\/p>\n<h2><strong>\u4fee\u6539\u6570\u7ec4\u5143\u7d20<\/strong><\/h2>\n<p>matrix[1, 2] = 10  # \u5c06\u7b2c\u4e8c\u884c\u7b2c\u4e09\u5217\u7684\u5143\u7d20\u4fee\u6539\u4e3a10<\/p>\n<h2><strong>\u6570\u7ec4\u5207\u7247<\/strong><\/h2>\n<p>sub_matrix = matrix[:, 1:3]  # \u63d0\u53d6\u6240\u6709\u884c\u7684\u7b2c2\u5230\u7b2c3\u5217<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>3\u3001\u4f7f\u7528<code>numpy.savetxt<\/code>\u51fd\u6570\u5199\u5165\u6587\u672c\u6587\u4ef6<\/h4>\n<\/p>\n<p><p><code>numpy.savetxt<\/code>\u51fd\u6570\u662f\u5c06NumPy\u6570\u7ec4\u4fdd\u5b58\u4e3a\u6587\u672c\u6587\u4ef6\u7684\u4e3b\u8981\u65b9\u6cd5\u3002\u5176\u4e3b\u8981\u53c2\u6570\u5982\u4e0b\uff1a<\/p>\n<\/p>\n<ul>\n<li><code>fname<\/code>\uff1a\u6587\u4ef6\u540d\u6216\u6587\u4ef6\u5bf9\u8c61\u3002<\/li>\n<li><code>X<\/code>\uff1a\u8981\u4fdd\u5b58\u7684\u6570\u7ec4\u3002<\/li>\n<li><code>fmt<\/code>\uff1a\u5199\u5165\u6570\u636e\u7684\u683c\u5f0f\uff0c\u4f8b\u5982<code>&#39;%d&#39;<\/code>\u8868\u793a\u6574\u6570\uff0c<code>&#39;%.2f&#39;<\/code>\u8868\u793a\u4fdd\u7559\u4e24\u4f4d\u5c0f\u6570\u7684\u6d6e\u70b9\u6570\u3002<\/li>\n<li><code>delimiter<\/code>\uff1a\u5206\u9694\u7b26\uff0c\u9ed8\u8ba4\u4e3a\u7a7a\u683c\u3002<\/li>\n<\/ul>\n<p><pre><code class=\"language-python\">np.savetxt(&#39;matrix.txt&#39;, matrix, fmt=&#39;%d&#39;, delimiter=&#39; &#39;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>4\u3001\u8bfb\u53d6\u6587\u672c\u6587\u4ef6\u5e76\u9a8c\u8bc1<\/h4>\n<\/p>\n<p><p>\u4e3a\u4e86\u786e\u4fdd\u6570\u636e\u6b63\u786e\u5199\u5165\uff0c\u53ef\u4ee5\u4f7f\u7528<code>numpy.loadtxt<\/code>\u51fd\u6570\u8bfb\u53d6\u6587\u672c\u6587\u4ef6\u5e76\u9a8c\u8bc1\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">loaded_matrix = np.loadtxt(&#39;matrix.txt&#39;, delimiter=&#39; &#39;)<\/p>\n<p>print(loaded_matrix)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p><code>numpy.loadtxt<\/code>\u51fd\u6570\u53ef\u4ee5\u5c06\u6587\u672c\u6587\u4ef6\u4e2d\u7684\u6570\u636e\u8bfb\u5165NumPy\u6570\u7ec4\uff0c<code>delimiter<\/code>\u53c2\u6570\u6307\u5b9a\u5206\u9694\u7b26\u3002<\/p>\n<\/p>\n<p><h3>\u4e94\u3001\u603b\u7ed3<\/h3>\n<\/p>\n<p><p>\u901a\u8fc7\u4ee5\u4e0a\u65b9\u6cd5\uff0cPython\u53ef\u4ee5\u65b9\u4fbf\u5730\u5c06\u77e9\u9635\u5199\u5165.txt\u6587\u4ef6\u3002<strong>\u4f7f\u7528\u6807\u51c6\u6587\u4ef6\u64cd\u4f5c\u9002\u7528\u4e8e\u7b80\u5355\u7684\u6570\u636e\u7ed3\u6784\uff0c\u4f7f\u7528NumPy\u5e93\u9002\u7528\u4e8e\u5927\u89c4\u6a21\u6570\u636e\u5904\u7406\uff0c\u4f7f\u7528Pandas\u5e93\u9002\u7528\u4e8e\u6570\u636e\u5206\u6790\u548c\u64cd\u4f5c\u3002<\/strong> \u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0c\u6839\u636e\u5177\u4f53\u9700\u6c42\u9009\u62e9\u5408\u9002\u7684\u65b9\u6cd5\u53ef\u4ee5\u63d0\u9ad8\u4ee3\u7801\u7684\u6548\u7387\u548c\u53ef\u8bfb\u6027\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728Python\u4e2d\u521b\u5efa\u4e00\u4e2a\u77e9\u9635\u5e76\u5c06\u5176\u5199\u5165.txt\u6587\u4ef6\uff1f<\/strong><br \/>\u5728Python\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528NumPy\u5e93\u521b\u5efa\u77e9\u9635\uff0c\u7136\u540e\u901a\u8fc7\u7b80\u5355\u7684\u6587\u4ef6\u5199\u5165\u64cd\u4f5c\u5c06\u5176\u4fdd\u5b58\u4e3a.txt\u6587\u4ef6\u3002\u9996\u5148\uff0c\u786e\u4fdd\u5b89\u88c5\u4e86NumPy\u5e93\u3002\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u4ee3\u7801\u521b\u5efa\u4e00\u4e2a\u77e9\u9635\u5e76\u4fdd\u5b58\uff1a  <\/p>\n<pre><code class=\"language-python\">import numpy as np\n\n# \u521b\u5efa\u4e00\u4e2a\u793a\u4f8b\u77e9\u9635\nmatrix = np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]])\n\n# \u5c06\u77e9\u9635\u5199\u5165.txt\u6587\u4ef6\nnp.savetxt(&#39;matrix.txt&#39;, matrix, fmt=&#39;%d&#39;)\n<\/code><\/pre>\n<p>\u8fd9\u6bb5\u4ee3\u7801\u5c06\u751f\u6210\u4e00\u4e2a\u540d\u4e3a<code>matrix.txt<\/code>\u7684\u6587\u4ef6\uff0c\u91cc\u9762\u5305\u542b\u4e86\u77e9\u9635\u7684\u5185\u5bb9\u3002<\/p>\n<p><strong>\u4f7f\u7528Python\u5c06\u77e9\u9635\u5199\u5165.txt\u6587\u4ef6\u65f6\uff0c\u5982\u4f55\u81ea\u5b9a\u4e49\u5206\u9694\u7b26\uff1f<\/strong><br \/>\u5728\u4f7f\u7528NumPy\u7684<code>savetxt<\/code>\u51fd\u6570\u65f6\uff0c\u53ef\u4ee5\u901a\u8fc7<code>delimiter<\/code>\u53c2\u6570\u81ea\u5b9a\u4e49\u5206\u9694\u7b26\u3002\u4f8b\u5982\uff0c\u5982\u679c\u5e0c\u671b\u7528\u9017\u53f7\u5206\u9694\u77e9\u9635\u7684\u5143\u7d20\uff0c\u53ef\u4ee5\u8fd9\u6837\u64cd\u4f5c\uff1a  <\/p>\n<pre><code class=\"language-python\">np.savetxt(&#39;matrix.csv&#39;, matrix, delimiter=&#39;,&#39;, fmt=&#39;%d&#39;)\n<\/code><\/pre>\n<p>\u8fd9\u5c06\u751f\u6210\u4e00\u4e2a\u4ee5\u9017\u53f7\u5206\u9694\u7684\u6587\u4ef6\uff0c\u9002\u5408\u4e8eCSV\u683c\u5f0f\u3002<\/p>\n<p><strong>\u6709\u4ec0\u4e48\u65b9\u6cd5\u53ef\u4ee5\u5728\u5199\u5165.txt\u6587\u4ef6\u65f6\u4fdd\u7559\u77e9\u9635\u7684\u683c\u5f0f\uff1f<\/strong><br \/>\u4e3a\u4e86\u4fdd\u7559\u77e9\u9635\u7684\u683c\u5f0f\uff0c\u53ef\u4ee5\u4f7f\u7528Python\u5185\u7f6e\u7684\u6587\u4ef6\u5199\u5165\u65b9\u6cd5\u3002\u901a\u8fc7\u5faa\u73af\u904d\u5386\u77e9\u9635\u7684\u884c\u548c\u5217\uff0c\u53ef\u4ee5\u5b9e\u73b0\u66f4\u7075\u6d3b\u7684\u683c\u5f0f\u63a7\u5236\u3002\u4f8b\u5982\uff1a  <\/p>\n<pre><code class=\"language-python\">with open(&#39;matrix_formatted.txt&#39;, &#39;w&#39;) as f:\n    for row in matrix:\n        f.write(&#39; &#39;.join(map(str, row)) + &#39;\\n&#39;)\n<\/code><\/pre>\n<p>\u8fd9\u6837\u7684\u5199\u5165\u65b9\u5f0f\u53ef\u4ee5\u8ba9\u7528\u6237\u81ea\u5b9a\u4e49\u6bcf\u884c\u7684\u683c\u5f0f\uff0c\u63d0\u4f9b\u66f4\u591a\u7684\u7075\u6d3b\u6027\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u4f7f\u7528Python\u5c06\u77e9\u9635\u5199\u5165.txt\u6587\u4ef6\u53ef\u4ee5\u901a\u8fc7\u591a\u79cd\u65b9\u6cd5\u5b9e\u73b0\uff0c\u4e3b\u8981\u5305\u62ec\uff1a\u4f7f\u7528\u6807\u51c6\u7684\u6587\u4ef6\u64cd\u4f5c\u3001\u4f7f\u7528NumPy\u5e93\u3001\u4f7f [&hellip;]","protected":false},"author":3,"featured_media":1042492,"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\/1042482"}],"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=1042482"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1042482\/revisions"}],"predecessor-version":[{"id":1042493,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1042482\/revisions\/1042493"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1042492"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1042482"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1042482"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1042482"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}