{"id":1182970,"date":"2025-01-15T19:09:21","date_gmt":"2025-01-15T11:09:21","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1182970.html"},"modified":"2025-01-15T19:09:23","modified_gmt":"2025-01-15T11:09:23","slug":"python%e6%95%b0%e6%8d%ae%e5%a6%82%e4%bd%95%e5%90%91%e4%b8%8a%e5%8f%96%e6%95%b4","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1182970.html","title":{"rendered":"python\u6570\u636e\u5982\u4f55\u5411\u4e0a\u53d6\u6574"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25132904\/1d030c44-2f88-4d0e-b4f7-486248e9b2dc.webp\" alt=\"python\u6570\u636e\u5982\u4f55\u5411\u4e0a\u53d6\u6574\" \/><\/p>\n<p><p> \u8981\u5728Python\u4e2d\u5bf9\u6570\u636e\u8fdb\u884c\u5411\u4e0a\u53d6\u6574\uff0c\u53ef\u4ee5\u4f7f\u7528\u591a\u79cd\u65b9\u6cd5\u3002<strong>\u6700\u5e38\u7528\u7684\u65b9\u6cd5\u662f\u4f7f\u7528math\u6a21\u5757\u4e2d\u7684ceil\u51fd\u6570\u3001numpy\u5e93\u4e2d\u7684ceil\u51fd\u6570\u548c\u901a\u8fc7\u81ea\u5b9a\u4e49\u51fd\u6570\u6765\u5b9e\u73b0\u5411\u4e0a\u53d6\u6574<\/strong>\u3002\u5176\u4e2d\uff0cmath\u6a21\u5757\u548cnumpy\u5e93\u63d0\u4f9b\u4e86\u9ad8\u6548\u4e14\u6613\u7528\u7684\u5411\u4e0a\u53d6\u6574\u65b9\u6cd5\u3002\u4e0b\u9762\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u8fd9\u51e0\u79cd\u65b9\u6cd5\uff0c\u5e76\u901a\u8fc7\u4ee3\u7801\u793a\u4f8b\u8bf4\u660e\u5b83\u4eec\u7684\u4f7f\u7528\u3002<\/p>\n<\/p>\n<p><h3>\u4e00\u3001\u4f7f\u7528math\u6a21\u5757\u4e2d\u7684ceil\u51fd\u6570<\/h3>\n<\/p>\n<p><h4>1\u3001\u5bfc\u5165math\u6a21\u5757<\/h4>\n<\/p>\n<p><p>\u9996\u5148\uff0c\u6211\u4eec\u9700\u8981\u5bfc\u5165math\u6a21\u5757\uff0c\u8fd9\u662fPython\u7684\u5185\u7f6e\u6a21\u5757\uff0c\u65e0\u9700\u989d\u5916\u5b89\u88c5\u3002math\u6a21\u5757\u63d0\u4f9b\u4e86\u8bb8\u591a\u6570\u5b66\u51fd\u6570\uff0c\u5176\u4e2d\u7684ceil\u51fd\u6570\u53ef\u4ee5\u7528\u4e8e\u5411\u4e0a\u53d6\u6574\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import math<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2\u3001\u4f7f\u7528ceil\u51fd\u6570<\/h4>\n<\/p>\n<p><p>math.ceil(x)\u51fd\u6570\u8fd4\u56de\u5927\u4e8e\u6216\u7b49\u4e8ex\u7684\u6700\u5c0f\u6574\u6570\u3002\u6bd4\u5982\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import math<\/p>\n<p>num = 3.14<\/p>\n<p>result = math.ceil(num)<\/p>\n<p>print(result)  # \u8f93\u51fa 4<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u4f8b\u5b50\u4e2d\uff0c3.14\u88ab\u5411\u4e0a\u53d6\u6574\u4e3a4\u3002math.ceil\u51fd\u6570\u5bf9\u4e8e\u5355\u4e2a\u6d6e\u70b9\u6570\u7684\u5411\u4e0a\u53d6\u6574\u975e\u5e38\u65b9\u4fbf\u3002<\/p>\n<\/p>\n<p><h4>3\u3001\u5e94\u7528\u573a\u666f<\/h4>\n<\/p>\n<p><p>math.ceil\u51fd\u6570\u9002\u7528\u4e8e\u9700\u8981\u5bf9\u6d6e\u70b9\u6570\u8fdb\u884c\u5411\u4e0a\u53d6\u6574\u7684\u5404\u79cd\u573a\u666f\uff0c\u6bd4\u5982\u8ba1\u7b97\u4ef7\u683c\u3001\u5904\u7406\u65f6\u95f4\u7b49\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import math<\/p>\n<p>price = 19.99<\/p>\n<p>rounded_price = math.ceil(price)<\/p>\n<p>print(f&quot;The rounded price is: {rounded_price}&quot;)  # \u8f93\u51fa The rounded price is: 20<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e8c\u3001\u4f7f\u7528numpy\u5e93\u4e2d\u7684ceil\u51fd\u6570<\/h3>\n<\/p>\n<p><h4>1\u3001\u5bfc\u5165numpy\u5e93<\/h4>\n<\/p>\n<p><p>numpy\u662f\u4e00\u4e2a\u5f3a\u5927\u7684\u79d1\u5b66\u8ba1\u7b97\u5e93\uff0c\u5982\u679c\u6ca1\u6709\u5b89\u88c5\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install numpy<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u7136\u540e\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\u4f7f\u7528numpy\u7684ceil\u51fd\u6570<\/h4>\n<\/p>\n<p><p>numpy.ceil(array)\u51fd\u6570\u8fd4\u56de\u5927\u4e8e\u6216\u7b49\u4e8e\u8f93\u5165\u6570\u7ec4\u5143\u7d20\u7684\u6700\u5c0f\u6574\u6570\uff0c\u5411\u4e0a\u53d6\u6574\u540e\u7684\u7ed3\u679c\u4ee5\u6d6e\u70b9\u6570\u8868\u793a\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import numpy as np<\/p>\n<p>arr = np.array([1.1, 2.5, 3.7])<\/p>\n<p>result = np.ceil(arr)<\/p>\n<p>print(result)  # \u8f93\u51fa [2. 3. 4.]<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>3\u3001\u5e94\u7528\u573a\u666f<\/h4>\n<\/p>\n<p><p>numpy.ceil\u51fd\u6570\u9002\u7528\u4e8e\u9700\u8981\u5bf9\u6570\u7ec4\u6216\u77e9\u9635\u4e2d\u7684\u6240\u6709\u5143\u7d20\u8fdb\u884c\u5411\u4e0a\u53d6\u6574\u7684\u573a\u666f\uff0c\u7279\u522b\u9002\u5408\u5927\u89c4\u6a21\u6570\u636e\u5904\u7406\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import numpy as np<\/p>\n<p>arr = np.array([1.1, 2.5, 3.7, 4.2])<\/p>\n<p>rounded_arr = np.ceil(arr)<\/p>\n<p>print(f&quot;The rounded array is: {rounded_arr}&quot;)  # \u8f93\u51fa The rounded array is: [2. 3. 4. 5.]<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e09\u3001\u4f7f\u7528\u81ea\u5b9a\u4e49\u51fd\u6570\u8fdb\u884c\u5411\u4e0a\u53d6\u6574<\/h3>\n<\/p>\n<p><h4>1\u3001\u5b9a\u4e49\u81ea\u5b9a\u4e49\u51fd\u6570<\/h4>\n<\/p>\n<p><p>\u6211\u4eec\u4e5f\u53ef\u4ee5\u901a\u8fc7\u81ea\u5b9a\u4e49\u51fd\u6570\u6765\u5b9e\u73b0\u5411\u4e0a\u53d6\u6574\uff0c\u8fd9\u6837\u53ef\u4ee5\u6839\u636e\u5177\u4f53\u9700\u6c42\u8fdb\u884c\u7075\u6d3b\u8c03\u6574\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">def custom_ceil(x):<\/p>\n<p>    if int(x) == x:<\/p>\n<p>        return int(x)<\/p>\n<p>    else:<\/p>\n<p>        return int(x) + 1<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2\u3001\u4f7f\u7528\u81ea\u5b9a\u4e49\u51fd\u6570<\/h4>\n<\/p>\n<p><p>\u81ea\u5b9a\u4e49\u51fd\u6570\u53ef\u4ee5\u6839\u636e\u5177\u4f53\u9700\u6c42\u8fdb\u884c\u4fee\u6539\u548c\u4f7f\u7528\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">num = 3.14<\/p>\n<p>result = custom_ceil(num)<\/p>\n<p>print(result)  # \u8f93\u51fa 4<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>3\u3001\u5e94\u7528\u573a\u666f<\/h4>\n<\/p>\n<p><p>\u81ea\u5b9a\u4e49\u51fd\u6570\u9002\u7528\u4e8e\u7279\u6b8a\u9700\u6c42\u7684\u573a\u666f\uff0c\u6bd4\u5982\u5f53\u6211\u4eec\u9700\u8981\u5bf9\u67d0\u4e9b\u7279\u5b9a\u6761\u4ef6\u8fdb\u884c\u5904\u7406\u65f6\uff0c\u53ef\u4ee5\u901a\u8fc7\u81ea\u5b9a\u4e49\u51fd\u6570\u6765\u5b9e\u73b0\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">def custom_ceil(x):<\/p>\n<p>    if x % 2 == 0:<\/p>\n<p>        return x<\/p>\n<p>    else:<\/p>\n<p>        return int(x) + 1<\/p>\n<p>num = 5<\/p>\n<p>result = custom_ceil(num)<\/p>\n<p>print(f&quot;The custom rounded number is: {result}&quot;)  # \u8f93\u51fa The custom rounded number is: 6<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u56db\u3001\u7ed3\u5408pandas\u5e93\u8fdb\u884c\u6570\u636e\u5904\u7406<\/h3>\n<\/p>\n<p><p>pandas\u662f\u4e00\u4e2a\u5f3a\u5927\u7684\u6570\u636e\u5206\u6790\u5e93\uff0c\u5e7f\u6cdb\u7528\u4e8e\u6570\u636e\u5904\u7406\u4e0e\u5206\u6790\u3002\u5728pandas\u4e2d\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528apply\u51fd\u6570\u7ed3\u5408math.ceil\u6216numpy.ceil\u8fdb\u884c\u5411\u4e0a\u53d6\u6574\u3002<\/p>\n<\/p>\n<p><h4>1\u3001\u5bfc\u5165pandas\u5e93<\/h4>\n<\/p>\n<p><p>\u5982\u679c\u6ca1\u6709\u5b89\u88c5\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install pandas<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u7136\u540e\u5bfc\u5165pandas\u5e93\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import pandas as pd<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2\u3001\u521b\u5efaDataFrame\u5e76\u8fdb\u884c\u5411\u4e0a\u53d6\u6574<\/h4>\n<\/p>\n<p><p>\u6211\u4eec\u53ef\u4ee5\u521b\u5efa\u4e00\u4e2aDataFrame\u5e76\u4f7f\u7528apply\u51fd\u6570\u5bf9\u5176\u4e2d\u7684\u5143\u7d20\u8fdb\u884c\u5411\u4e0a\u53d6\u6574\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import pandas as pd<\/p>\n<p>import numpy as np<\/p>\n<p>data = {&#39;values&#39;: [1.2, 2.5, 3.8, 4.1]}<\/p>\n<p>df = pd.DataFrame(data)<\/p>\n<p>df[&#39;rounded_values&#39;] = df[&#39;values&#39;].apply(np.ceil)<\/p>\n<p>print(df)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>3\u3001\u5e94\u7528\u573a\u666f<\/h4>\n<\/p>\n<p><p>pandas\u4e2d\u7684apply\u51fd\u6570\u7ed3\u5408numpy.ceil\u51fd\u6570\u975e\u5e38\u9002\u7528\u4e8e\u5bf9DataFrame\u4e2d\u7684\u6570\u636e\u8fdb\u884c\u6279\u91cf\u5904\u7406\uff0c\u7279\u522b\u662f\u5904\u7406\u91d1\u878d\u6570\u636e\u3001\u7edf\u8ba1\u6570\u636e\u7b49\u573a\u666f\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import pandas as pd<\/p>\n<p>import numpy as np<\/p>\n<p>data = {&#39;prices&#39;: [19.99, 29.49, 49.89, 99.99]}<\/p>\n<p>df = pd.DataFrame(data)<\/p>\n<p>df[&#39;rounded_prices&#39;] = df[&#39;prices&#39;].apply(np.ceil)<\/p>\n<p>print(df)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e94\u3001\u5904\u7406NaN\u503c\u548c\u5f02\u5e38\u503c<\/h3>\n<\/p>\n<p><p>\u5728\u5b9e\u9645\u6570\u636e\u5904\u7406\u4e2d\uff0c\u6211\u4eec\u53ef\u80fd\u4f1a\u9047\u5230NaN\u503c\u548c\u5f02\u5e38\u503c\u3002\u6211\u4eec\u9700\u8981\u5728\u5411\u4e0a\u53d6\u6574\u4e4b\u524d\u5904\u7406\u8fd9\u4e9b\u503c\u3002<\/p>\n<\/p>\n<p><h4>1\u3001\u5904\u7406NaN\u503c<\/h4>\n<\/p>\n<p><p>\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528pandas\u4e2d\u7684fillna\u51fd\u6570\u586b\u5145NaN\u503c\uff0c\u7136\u540e\u518d\u8fdb\u884c\u5411\u4e0a\u53d6\u6574\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import pandas as pd<\/p>\n<p>import numpy as np<\/p>\n<p>data = {&#39;values&#39;: [1.2, np.nan, 3.8, 4.1]}<\/p>\n<p>df = pd.DataFrame(data)<\/p>\n<p>df[&#39;values&#39;].fillna(0, inplace=True)<\/p>\n<p>df[&#39;rounded_values&#39;] = df[&#39;values&#39;].apply(np.ceil)<\/p>\n<p>print(df)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2\u3001\u5904\u7406\u5f02\u5e38\u503c<\/h4>\n<\/p>\n<p><p>\u6211\u4eec\u53ef\u4ee5\u5b9a\u4e49\u4e00\u4e2a\u51fd\u6570\u6765\u5904\u7406\u5f02\u5e38\u503c\uff0c\u7136\u540e\u518d\u8fdb\u884c\u5411\u4e0a\u53d6\u6574\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import pandas as pd<\/p>\n<p>import numpy as np<\/p>\n<p>data = {&#39;values&#39;: [1.2, 1000, 3.8, 4.1]}<\/p>\n<p>df = pd.DataFrame(data)<\/p>\n<p>def handle_outliers(x):<\/p>\n<p>    if x &gt; 100:<\/p>\n<p>        return 100<\/p>\n<p>    return x<\/p>\n<p>df[&#39;values&#39;] = df[&#39;values&#39;].apply(handle_outliers)<\/p>\n<p>df[&#39;rounded_values&#39;] = df[&#39;values&#39;].apply(np.ceil)<\/p>\n<p>print(df)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u516d\u3001\u603b\u7ed3<\/h3>\n<\/p>\n<p><p>\u5728Python\u4e2d\u8fdb\u884c\u6570\u636e\u7684\u5411\u4e0a\u53d6\u6574\uff0c\u53ef\u4ee5\u4f7f\u7528math\u6a21\u5757\u4e2d\u7684ceil\u51fd\u6570\u3001numpy\u5e93\u4e2d\u7684ceil\u51fd\u6570\u548c\u81ea\u5b9a\u4e49\u51fd\u6570\u6765\u5b9e\u73b0\u3002<strong>math\u6a21\u5757\u4e2d\u7684ceil\u51fd\u6570\u9002\u7528\u4e8e\u5355\u4e2a\u6d6e\u70b9\u6570\u7684\u5411\u4e0a\u53d6\u6574\u3001numpy\u7684ceil\u51fd\u6570\u9002\u7528\u4e8e\u6570\u7ec4\u6216\u77e9\u9635\u7684\u5411\u4e0a\u53d6\u6574\u3001\u81ea\u5b9a\u4e49\u51fd\u6570\u9002\u7528\u4e8e\u7279\u6b8a\u9700\u6c42\u7684\u573a\u666f<\/strong>\u3002\u7ed3\u5408pandas\u5e93\uff0c\u6211\u4eec\u53ef\u4ee5\u5bf9DataFrame\u4e2d\u7684\u6570\u636e\u8fdb\u884c\u6279\u91cf\u5904\u7406\uff0c\u7279\u522b\u9002\u7528\u4e8e\u6570\u636e\u5206\u6790\u548c\u5904\u7406\u7684\u573a\u666f\u3002\u5728\u5904\u7406\u5b9e\u9645\u6570\u636e\u65f6\uff0c\u8fd8\u9700\u8981\u8003\u8651NaN\u503c\u548c\u5f02\u5e38\u503c\u7684\u5904\u7406\uff0c\u4ee5\u786e\u4fdd\u6570\u636e\u7684\u5b8c\u6574\u6027\u548c\u51c6\u786e\u6027\u3002\u901a\u8fc7\u4ee5\u4e0a\u51e0\u79cd\u65b9\u6cd5\uff0c\u6211\u4eec\u53ef\u4ee5\u7075\u6d3b\u5730\u5bf9\u6570\u636e\u8fdb\u884c\u5411\u4e0a\u53d6\u6574\uff0c\u4ee5\u6ee1\u8db3\u4e0d\u540c\u7684\u9700\u6c42\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728Python\u4e2d\u5b9e\u73b0\u5411\u4e0a\u53d6\u6574\u7684\u64cd\u4f5c\uff1f<\/strong><br \/>\u5728Python\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528<code>math.ceil()<\/code>\u51fd\u6570\u6765\u8fdb\u884c\u5411\u4e0a\u53d6\u6574\u3002\u8be5\u51fd\u6570\u4f1a\u8fd4\u56de\u5927\u4e8e\u6216\u7b49\u4e8e\u7ed9\u5b9a\u6570\u5b57\u7684\u6700\u5c0f\u6574\u6570\u3002\u4f8b\u5982\uff0c<code>math.ceil(4.2)<\/code>\u5c06\u8fd4\u56de5\uff0c\u800c<code>math.ceil(-4.2)<\/code>\u5c06\u8fd4\u56de-4\u3002\u8981\u4f7f\u7528\u8be5\u51fd\u6570\uff0c\u9996\u5148\u9700\u8981\u5bfc\u5165<code>math<\/code>\u6a21\u5757\u3002<\/p>\n<p><strong>\u662f\u5426\u53ef\u4ee5\u4f7f\u7528\u5176\u4ed6\u65b9\u6cd5\u8fdb\u884c\u5411\u4e0a\u53d6\u6574\uff1f<\/strong><br \/>\u9664\u4e86<code>math.ceil()<\/code>\uff0c\u8fd8\u53ef\u4ee5\u901a\u8fc7\u7b80\u5355\u7684\u7b97\u672f\u8fd0\u7b97\u5b9e\u73b0\u5411\u4e0a\u53d6\u6574\u3002\u4f8b\u5982\uff0c\u53ef\u4ee5\u5c06\u6570\u5b57\u52a0\u4e0a0.999999\uff08\u5bf9\u4e8e\u6b63\u6570\uff09\u6216\u4f7f\u7528\u6574\u9664\u8fd0\u7b97\u7ed3\u5408\u6761\u4ef6\u8bed\u53e5\u3002\u5bf9\u4e8e\u6b63\u6570<code>x<\/code>\uff0c\u53ef\u4ee5\u901a\u8fc7<code>int(x) + (x % 1 &gt; 0)<\/code>\u6765\u5b9e\u73b0\u5411\u4e0a\u53d6\u6574\u3002<\/p>\n<p><strong>\u5728\u5904\u7406\u6570\u636e\u5217\u8868\u65f6\uff0c\u5982\u4f55\u5bf9\u6240\u6709\u5143\u7d20\u8fdb\u884c\u5411\u4e0a\u53d6\u6574\uff1f<\/strong><br \/>\u53ef\u4ee5\u4f7f\u7528\u5217\u8868\u63a8\u5bfc\u5f0f\u7ed3\u5408<code>math.ceil()<\/code>\u51fd\u6570\u6765\u5bf9\u5217\u8868\u4e2d\u7684\u6bcf\u4e2a\u5143\u7d20\u8fdb\u884c\u5411\u4e0a\u53d6\u6574\u3002\u4f8b\u5982\uff0c\u5bf9\u4e8e\u4e00\u4e2a\u5305\u542b\u6d6e\u70b9\u6570\u7684\u5217\u8868<code>numbers<\/code>\uff0c\u53ef\u4ee5\u4f7f\u7528<code>[math.ceil(num) for num in numbers]<\/code>\u6765\u751f\u6210\u4e00\u4e2a\u65b0\u7684\u5217\u8868\uff0c\u5176\u4e2d\u6bcf\u4e2a\u5143\u7d20\u90fd\u662f\u5bf9\u5e94\u539f\u5217\u8868\u5143\u7d20\u7684\u5411\u4e0a\u53d6\u6574\u7ed3\u679c\u3002\u8fd9\u6837\u53ef\u4ee5\u6709\u6548\u5730\u5904\u7406\u5927\u91cf\u6570\u636e\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u8981\u5728Python\u4e2d\u5bf9\u6570\u636e\u8fdb\u884c\u5411\u4e0a\u53d6\u6574\uff0c\u53ef\u4ee5\u4f7f\u7528\u591a\u79cd\u65b9\u6cd5\u3002\u6700\u5e38\u7528\u7684\u65b9\u6cd5\u662f\u4f7f\u7528math\u6a21\u5757\u4e2d\u7684ceil\u51fd\u6570\u3001num [&hellip;]","protected":false},"author":3,"featured_media":1182979,"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\/1182970"}],"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=1182970"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1182970\/revisions"}],"predecessor-version":[{"id":1182981,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1182970\/revisions\/1182981"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1182979"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1182970"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1182970"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1182970"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}