{"id":934131,"date":"2024-12-26T18:29:53","date_gmt":"2024-12-26T10:29:53","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/934131.html"},"modified":"2024-12-26T18:29:56","modified_gmt":"2024-12-26T10:29:56","slug":"python%e5%a6%82%e4%bd%95%e5%bc%95%e5%85%a5pandas","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/934131.html","title":{"rendered":"python\u5982\u4f55\u5f15\u5165pandas"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25071253\/45d8a5bc-8ddb-49a3-8c04-4649e542eb6d.webp\" alt=\"python\u5982\u4f55\u5f15\u5165pandas\" \/><\/p>\n<p><p> <strong>\u8981\u5728Python\u4e2d\u5f15\u5165pandas\u5e93\uff0c\u53ef\u4ee5\u4f7f\u7528<code>import pandas as pd<\/code>\u8bed\u53e5\u3002pandas\u5e93\u662f\u4e00\u79cd\u5f3a\u5927\u7684\u6570\u636e\u5206\u6790\u548c\u6570\u636e\u5904\u7406\u5de5\u5177\uff0c\u7279\u522b\u9002\u5408\u5904\u7406\u7ed3\u6784\u5316\u6570\u636e\u3002<\/strong>\u5b83\u63d0\u4f9b\u4e86\u7075\u6d3b\u7684\u6570\u636e\u7ed3\u6784\uff0c\u53ef\u4ee5\u6709\u6548\u5730\u5904\u7406\u5927\u91cf\u6570\u636e\u3002\u901a\u8fc7\u4f7f\u7528pandas\uff0c\u60a8\u53ef\u4ee5\u8f7b\u677e\u8fdb\u884c\u6570\u636e\u6e05\u6d17\u3001\u64cd\u4f5c\u548c\u5206\u6790\u3002\u5f15\u5165pandas\u7684\u7b2c\u4e00\u6b65\u662f\u786e\u4fdd\u5df2\u5b89\u88c5\u8be5\u5e93\uff0c\u7136\u540e\u5728\u4ee3\u7801\u4e2d\u5bfc\u5165\u3002\u4ee5\u4e0b\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u5982\u4f55\u5728Python\u4e2d\u5f15\u5165\u5e76\u4f7f\u7528pandas\u3002<\/p>\n<\/p>\n<p><p>\u4e00\u3001\u5b89\u88c5pandas<\/p>\n<\/p>\n<p><p>\u5728\u4f7f\u7528pandas\u4e4b\u524d\uff0c\u9996\u5148\u9700\u8981\u5b89\u88c5\u8fd9\u4e2a\u5e93\u3002pandas\u5e93\u53ef\u4ee5\u901a\u8fc7Python\u7684\u5305\u7ba1\u7406\u5668pip\u8fdb\u884c\u5b89\u88c5\u3002\u5728\u7ec8\u7aef\u6216\u547d\u4ee4\u63d0\u793a\u7b26\u4e2d\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install pandas<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u786e\u4fdd\u60a8\u7684\u8ba1\u7b97\u673a\u5df2\u7ecf\u5b89\u88c5\u4e86Python\u548cpip\u3002\u5982\u679c\u6ca1\u6709\u5b89\u88c5\uff0c\u53ef\u4ee5\u4ecePython\u5b98\u65b9\u7f51\u7ad9\u4e0b\u8f7d\u6700\u65b0\u7248\u672c\u7684Python\uff0c\u5e76\u786e\u4fdd\u5728\u5b89\u88c5\u8fc7\u7a0b\u4e2d\u9009\u62e9\u6dfb\u52a0pip\u5230\u7cfb\u7edf\u8def\u5f84\u7684\u9009\u9879\u3002<\/p>\n<\/p>\n<p><p>\u4e8c\u3001\u5bfc\u5165pandas\u5e93<\/p>\n<\/p>\n<p><p>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u60a8\u53ef\u4ee5\u5728Python\u811a\u672c\u4e2d\u4f7f\u7528\u4ee5\u4e0b\u4ee3\u7801\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><p>\u901a\u8fc7\u4f7f\u7528<code>as pd<\/code>\uff0c\u60a8\u53ef\u4ee5\u4e3apandas\u6307\u5b9a\u4e00\u4e2a\u7b80\u77ed\u7684\u522b\u540d\uff0c\u8fd9\u6837\u5728\u540e\u7eed\u7684\u4ee3\u7801\u4e2d\u5f15\u7528pandas\u65f6\u53ef\u4ee5\u7b80\u5316\u4ee3\u7801\u4e66\u5199\u3002<\/p>\n<\/p>\n<p><p>\u4e09\u3001pandas\u7684\u57fa\u672c\u6570\u636e\u7ed3\u6784<\/p>\n<\/p>\n<p><p>pandas\u4e3b\u8981\u63d0\u4f9b\u4e86\u4e24\u79cd\u6570\u636e\u7ed3\u6784\uff1aSeries\u548cDataFrame\u3002\u8fd9\u4e24\u79cd\u6570\u636e\u7ed3\u6784\u662fpandas\u5e93\u7684\u6838\u5fc3\uff0c\u4e86\u89e3\u5b83\u4eec\u7684\u7279\u6027\u548c\u4f7f\u7528\u65b9\u6cd5\u662f\u638c\u63e1pandas\u7684\u5173\u952e\u3002<\/p>\n<\/p>\n<ol>\n<li><strong>Series<\/strong><\/li>\n<\/ol>\n<p><p>Series\u662f\u4e00\u79cd\u7c7b\u4f3c\u4e8e\u4e00\u7ef4\u6570\u7ec4\u7684\u5bf9\u8c61\uff0c\u5b83\u7531\u4e00\u7ec4\u6570\u636e\uff08\u5404\u79cdNumPy\u6570\u636e\u7c7b\u578b\uff09\u4ee5\u53ca\u4e00\u7ec4\u4e0e\u4e4b\u76f8\u5173\u7684\u6570\u636e\u6807\u7b7e\uff08\u5373\u7d22\u5f15\uff09\u7ec4\u6210\u3002\u60a8\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u4ee3\u7801\u521b\u5efa\u4e00\u4e2aSeries\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import pandas as pd<\/p>\n<p>s = pd.Series([1, 2, 3, 4, 5], index=[&#39;a&#39;, &#39;b&#39;, &#39;c&#39;, &#39;d&#39;, &#39;e&#39;])<\/p>\n<p>print(s)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u901a\u8fc7\u6307\u5b9a\u7d22\u5f15\uff0c\u53ef\u4ee5\u65b9\u4fbf\u5730\u8bbf\u95eeSeries\u4e2d\u7684\u6570\u636e\u3002<\/p>\n<\/p>\n<ol start=\"2\">\n<li><strong>DataFrame<\/strong><\/li>\n<\/ol>\n<p><p>DataFrame\u662f\u4e00\u4e2a\u4e8c\u7ef4\u7684\u6807\u8bb0\u6570\u636e\u7ed3\u6784\uff0c\u60a8\u53ef\u4ee5\u5c06\u5176\u89c6\u4f5c\u4e00\u4e2a\u8868\u683c\u6216\u7535\u5b50\u8868\u683c\u7684\u683c\u5f0f\u3002DataFrame\u65e2\u6709\u884c\u7d22\u5f15\u4e5f\u6709\u5217\u7d22\u5f15\u3002\u4ee5\u4e0b\u662f\u521b\u5efaDataFrame\u7684\u793a\u4f8b\u4ee3\u7801\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import pandas as pd<\/p>\n<p>data = {<\/p>\n<p>    &#39;Name&#39;: [&#39;John&#39;, &#39;Anna&#39;, &#39;Peter&#39;, &#39;Linda&#39;],<\/p>\n<p>    &#39;Age&#39;: [28, 24, 35, 32],<\/p>\n<p>    &#39;City&#39;: [&#39;New York&#39;, &#39;Paris&#39;, &#39;Berlin&#39;, &#39;London&#39;]<\/p>\n<p>}<\/p>\n<p>df = pd.DataFrame(data)<\/p>\n<p>print(df)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>DataFrame\u63d0\u4f9b\u4e86\u4e30\u5bcc\u7684\u65b9\u6cd5\u548c\u5c5e\u6027\uff0c\u4fbf\u4e8e\u8fdb\u884c\u6570\u636e\u64cd\u4f5c\u3002<\/p>\n<\/p>\n<p><p>\u56db\u3001pandas\u7684\u6838\u5fc3\u529f\u80fd<\/p>\n<\/p>\n<p><p>pandas\u63d0\u4f9b\u4e86\u4e00\u7cfb\u5217\u5f3a\u5927\u7684\u529f\u80fd\uff0c\u7528\u4e8e\u6570\u636e\u52a0\u8f7d\u3001\u6e05\u6d17\u3001\u5904\u7406\u548c\u5206\u6790\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u5e38\u7528\u7684\u529f\u80fd\uff1a<\/p>\n<\/p>\n<ol>\n<li><strong>\u6570\u636e\u52a0\u8f7d<\/strong><\/li>\n<\/ol>\n<p><p>pandas\u53ef\u4ee5\u4ece\u591a\u79cd\u6587\u4ef6\u683c\u5f0f\u4e2d\u8bfb\u53d6\u6570\u636e\uff0c\u5305\u62ecCSV\u3001Excel\u3001SQL\u6570\u636e\u5e93\u7b49\u3002\u8bfb\u53d6CSV\u6587\u4ef6\u7684\u57fa\u672c\u65b9\u6cd5\u5982\u4e0b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">df = pd.read_csv(&#39;data.csv&#39;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"2\">\n<li><strong>\u6570\u636e\u6e05\u6d17<\/strong><\/li>\n<\/ol>\n<p><p>\u5728\u6570\u636e\u5206\u6790\u8fc7\u7a0b\u4e2d\uff0c\u6570\u636e\u6e05\u6d17\u662f\u975e\u5e38\u91cd\u8981\u7684\u4e00\u6b65\u3002pandas\u63d0\u4f9b\u4e86\u8bb8\u591a\u65b9\u6cd5\u6765\u5904\u7406\u7f3a\u5931\u6570\u636e\u3001\u91cd\u590d\u6570\u636e\u7b49\u95ee\u9898\u3002\u4f8b\u5982\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528<code>dropna()<\/code>\u65b9\u6cd5\u5220\u9664\u5305\u542b\u7f3a\u5931\u503c\u7684\u884c\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">df_cleaned = df.dropna()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"3\">\n<li><strong>\u6570\u636e\u64cd\u4f5c<\/strong><\/li>\n<\/ol>\n<p><p>pandas\u5141\u8bb8\u60a8\u5bf9\u6570\u636e\u8fdb\u884c\u590d\u6742\u7684\u64cd\u4f5c\uff0c\u5305\u62ec\u8fc7\u6ee4\u3001\u6392\u5e8f\u3001\u5206\u7ec4\u548c\u805a\u5408\u7b49\u3002\u4ee5\u4e0b\u793a\u4f8b\u5c55\u793a\u4e86\u5982\u4f55\u6839\u636e\u6761\u4ef6\u8fc7\u6ee4DataFrame\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">filtered_df = df[df[&#39;Age&#39;] &gt; 30]<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"4\">\n<li><strong>\u6570\u636e\u5206\u6790<\/strong><\/li>\n<\/ol>\n<p><p>pandas\u63d0\u4f9b\u4e86\u591a\u79cd\u7edf\u8ba1\u548c\u5206\u6790\u529f\u80fd\uff0c\u4f8b\u5982\u63cf\u8ff0\u6027\u7edf\u8ba1\u3001\u76f8\u5173\u6027\u5206\u6790\u7b49\u3002\u60a8\u53ef\u4ee5\u4f7f\u7528<code>describe()<\/code>\u65b9\u6cd5\u83b7\u53d6DataFrame\u7684\u63cf\u8ff0\u6027\u7edf\u8ba1\u4fe1\u606f\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">df_description = df.describe()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4e94\u3001pandas\u7684\u9ad8\u7ea7\u5e94\u7528<\/p>\n<\/p>\n<p><p>\u9664\u4e86\u57fa\u672c\u529f\u80fd\u5916\uff0cpandas\u8fd8\u652f\u6301\u66f4\u9ad8\u7ea7\u7684\u6570\u636e\u5206\u6790\u548c\u64cd\u4f5c\uff0c\u4f8b\u5982\u65f6\u95f4\u5e8f\u5217\u5206\u6790\u3001\u6570\u636e\u900f\u89c6\u8868\u3001\u5408\u5e76\u548c\u8fde\u63a5\u7b49\u3002<\/p>\n<\/p>\n<ol>\n<li><strong>\u65f6\u95f4\u5e8f\u5217\u5206\u6790<\/strong><\/li>\n<\/ol>\n<p><p>pandas\u5bf9\u65f6\u95f4\u5e8f\u5217\u6570\u636e\u7684\u5904\u7406\u975e\u5e38\u5f3a\u5927\uff0c\u60a8\u53ef\u4ee5\u8f7b\u677e\u5730\u8fdb\u884c\u65e5\u671f\u7d22\u5f15\u3001\u9891\u7387\u8f6c\u6362\u548c\u65f6\u95f4\u5e8f\u5217\u8fd0\u7b97\u3002\u4ee5\u4e0b\u662f\u521b\u5efa\u65f6\u95f4\u5e8f\u5217\u7684\u793a\u4f8b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">date_rng = pd.date_range(start=&#39;2023-01-01&#39;, end=&#39;2023-01-10&#39;, freq=&#39;D&#39;)<\/p>\n<p>df_time_series = pd.DataFrame(date_rng, columns=[&#39;date&#39;])<\/p>\n<p>df_time_series[&#39;data&#39;] = pd.Series(range(len(date_rng)))<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"2\">\n<li><strong>\u6570\u636e\u900f\u89c6\u8868<\/strong><\/li>\n<\/ol>\n<p><p>\u6570\u636e\u900f\u89c6\u8868\u662f\u6570\u636e\u6c47\u603b\u548c\u5206\u6790\u7684\u5f3a\u5927\u5de5\u5177\uff0cpandas\u63d0\u4f9b\u4e86<code>pivot_table()<\/code>\u65b9\u6cd5\u6765\u751f\u6210\u6570\u636e\u900f\u89c6\u8868\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">pivot_table = pd.pivot_table(df, values=&#39;Age&#39;, index=[&#39;City&#39;], columns=[&#39;Name&#39;], aggfunc=&#39;mean&#39;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"3\">\n<li><strong>\u5408\u5e76\u548c\u8fde\u63a5<\/strong><\/li>\n<\/ol>\n<p><p>pandas\u53ef\u4ee5\u65b9\u4fbf\u5730\u5bf9\u591a\u4e2aDataFrame\u8fdb\u884c\u5408\u5e76\u548c\u8fde\u63a5\u64cd\u4f5c\u3002\u4f7f\u7528<code>merge()<\/code>\u65b9\u6cd5\u53ef\u4ee5\u5b9e\u73b0\u7c7b\u4f3cSQL\u4e2d\u7684JOIN\u64cd\u4f5c\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">merged_df = pd.merge(df1, df2, on=&#39;key&#39;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u516d\u3001pandas\u7684\u6027\u80fd\u4f18\u5316<\/p>\n<\/p>\n<p><p>\u5728\u5904\u7406\u5927\u89c4\u6a21\u6570\u636e\u65f6\uff0cpandas\u7684\u6027\u80fd\u4f18\u5316\u662f\u4e00\u4e2a\u91cd\u8981\u8003\u8651\u56e0\u7d20\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u63d0\u9ad8pandas\u6027\u80fd\u7684\u5efa\u8bae\uff1a<\/p>\n<\/p>\n<ol>\n<li><strong>\u4f7f\u7528\u5408\u9002\u7684\u6570\u636e\u7c7b\u578b<\/strong><\/li>\n<\/ol>\n<p><p>\u901a\u8fc7\u4f18\u5316\u6570\u636e\u7c7b\u578b\u53ef\u4ee5\u663e\u8457\u63d0\u9ad8pandas\u7684\u6027\u80fd\u3002\u4f8b\u5982\uff0c\u5c06\u6d6e\u70b9\u6570\u8f6c\u6362\u4e3a\u6574\u6570\u6216\u4f7f\u7528\u5206\u7c7b\u6570\u636e\u7c7b\u578b\u3002<\/p>\n<\/p>\n<ol start=\"2\">\n<li><strong>\u4f7f\u7528\u77e2\u91cf\u5316\u64cd\u4f5c<\/strong><\/li>\n<\/ol>\n<p><p>pandas\u4e2d\u7684\u8bb8\u591a\u64cd\u4f5c\u90fd\u662f\u77e2\u91cf\u5316\u7684\uff0c\u8fd9\u610f\u5473\u7740\u5b83\u4eec\u5728\u5e95\u5c42\u662f\u901a\u8fc7C\u8bed\u8a00\u5b9e\u73b0\u7684\uff0c\u975e\u5e38\u9ad8\u6548\u3002\u5c3d\u91cf\u907f\u514d\u4f7f\u7528Python\u7684\u5faa\u73af\u6765\u5904\u7406\u6570\u636e\uff0c\u800c\u662f\u4f7f\u7528pandas\u7684\u77e2\u91cf\u5316\u64cd\u4f5c\u3002<\/p>\n<\/p>\n<ol start=\"3\">\n<li><strong>\u4f7f\u7528\u5e76\u884c\u8ba1\u7b97<\/strong><\/li>\n<\/ol>\n<p><p>\u5bf9\u4e8e\u975e\u5e38\u5927\u7684\u6570\u636e\u96c6\uff0c\u53ef\u4ee5\u8003\u8651\u4f7f\u7528\u5e76\u884c\u8ba1\u7b97\u5e93\uff08\u5982Dask\uff09\u6765\u5206\u5e03\u5f0f\u5904\u7406\u6570\u636e\u3002<\/p>\n<\/p>\n<p><p>\u4e03\u3001\u603b\u7ed3<\/p>\n<\/p>\n<p><p>pandas\u662fPython\u4e2d\u5904\u7406\u7ed3\u6784\u5316\u6570\u636e\u7684\u5f3a\u5927\u5de5\u5177\uff0c\u63d0\u4f9b\u4e86\u4e30\u5bcc\u7684\u529f\u80fd\u7528\u4e8e\u6570\u636e\u52a0\u8f7d\u3001\u6e05\u6d17\u3001\u64cd\u4f5c\u548c\u5206\u6790\u3002\u901a\u8fc7\u672c\u6587\u7684\u4ecb\u7ecd\uff0c\u60a8\u5e94\u8be5\u5bf9\u5982\u4f55\u5728Python\u4e2d\u5f15\u5165\u548c\u4f7f\u7528pandas\u6709\u4e86\u4e00\u4e2a\u521d\u6b65\u7684\u4e86\u89e3\u3002\u638c\u63e1pandas\u7684\u4f7f\u7528\u6280\u5de7\uff0c\u5c06\u5927\u5927\u63d0\u9ad8\u60a8\u7684\u6570\u636e\u5904\u7406\u548c\u5206\u6790\u80fd\u529b\u3002\u65e0\u8bba\u662f\u8fdb\u884c\u7b80\u5355\u7684\u6570\u636e\u6e05\u6d17\uff0c\u8fd8\u662f\u590d\u6742\u7684\u6570\u636e\u5206\u6790\uff0cpandas\u90fd\u80fd\u4e3a\u60a8\u63d0\u4f9b\u6781\u5927\u7684\u4fbf\u5229\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728Python\u4e2d\u5b89\u88c5pandas\u5e93\uff1f<\/strong><br \/>\u8981\u5728Python\u4e2d\u4f7f\u7528pandas\u5e93\uff0c\u9996\u5148\u9700\u8981\u786e\u4fdd\u5b89\u88c5\u4e86\u5b83\u3002\u53ef\u4ee5\u901a\u8fc7pip\u547d\u4ee4\u8fdb\u884c\u5b89\u88c5\u3002\u5728\u547d\u4ee4\u884c\u4e2d\u8f93\u5165<code>pip install pandas<\/code>\uff0c\u8fd9\u6837\u5c31\u53ef\u4ee5\u4e0b\u8f7d\u5e76\u5b89\u88c5\u6700\u65b0\u7248\u672c\u7684pandas\u3002\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u53ef\u4ee5\u5728Python\u811a\u672c\u4e2d\u5bfc\u5165\u8be5\u5e93\u3002<\/p>\n<p><strong>\u5728Jupyter Notebook\u4e2d\u5982\u4f55\u5f15\u5165pandas\uff1f<\/strong><br \/>\u5982\u679c\u4f60\u5728\u4f7f\u7528Jupyter Notebook\uff0c\u53ef\u4ee5\u5728\u4ee3\u7801\u5355\u5143\u4e2d\u76f4\u63a5\u4f7f\u7528<code>import pandas as pd<\/code>\u6765\u5f15\u5165pandas\u5e93\u3002\u786e\u4fdd\u5728\u6267\u884c\u8fd9\u884c\u4ee3\u7801\u4e4b\u524d\uff0c\u5df2\u7ecf\u5728Notebook\u73af\u5883\u4e2d\u5b89\u88c5\u4e86pandas\u3002<\/p>\n<p><strong>pandas\u5e93\u63d0\u4f9b\u4e86\u54ea\u4e9b\u4e3b\u8981\u529f\u80fd\uff1f<\/strong><br \/>pandas\u5e93\u4e3b\u8981\u63d0\u4f9b\u6570\u636e\u7ed3\u6784\u548c\u6570\u636e\u5206\u6790\u5de5\u5177\u3002\u5b83\u5305\u542b\u4e86DataFrame\u548cSeries\u4e24\u79cd\u6838\u5fc3\u6570\u636e\u7ed3\u6784\uff0c\u652f\u6301\u6570\u636e\u7684\u6e05\u6d17\u3001\u5206\u6790\u548c\u53ef\u89c6\u5316\u529f\u80fd\u3002\u901a\u8fc7pandas\uff0c\u7528\u6237\u53ef\u4ee5\u8f7b\u677e\u5904\u7406\u7f3a\u5931\u6570\u636e\u3001\u8fdb\u884c\u6570\u636e\u7b5b\u9009\u548c\u5206\u7ec4\u64cd\u4f5c\uff0c\u4ee5\u53ca\u6267\u884c\u65f6\u95f4\u5e8f\u5217\u5206\u6790\u7b49\u591a\u79cd\u64cd\u4f5c\u3002<\/p>\n<p><strong>\u5f15\u5165pandas\u540e\uff0c\u5982\u4f55\u67e5\u770b\u5176\u7248\u672c\u4fe1\u606f\uff1f<\/strong><br \/>\u5728\u5bfc\u5165pandas\u5e93\u540e\uff0c\u53ef\u4ee5\u4f7f\u7528<code>pd.__version__<\/code>\u547d\u4ee4\u67e5\u770b\u5f53\u524d\u5b89\u88c5\u7684pandas\u7248\u672c\u3002\u8fd9\u5bf9\u4e8e\u786e\u4fdd\u5e93\u7684\u517c\u5bb9\u6027\u548c\u529f\u80fd\u6027\u5f88\u6709\u5e2e\u52a9\uff0c\u5c24\u5176\u662f\u5728\u5904\u7406\u7279\u5b9a\u6570\u636e\u96c6\u6216\u4f7f\u7528\u7279\u5b9a\u529f\u80fd\u65f6\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u8981\u5728Python\u4e2d\u5f15\u5165pandas\u5e93\uff0c\u53ef\u4ee5\u4f7f\u7528import pandas as pd\u8bed\u53e5\u3002pandas\u5e93\u662f\u4e00\u79cd [&hellip;]","protected":false},"author":3,"featured_media":934136,"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\/934131"}],"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=934131"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/934131\/revisions"}],"predecessor-version":[{"id":934137,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/934131\/revisions\/934137"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/934136"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=934131"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=934131"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=934131"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}