{"id":1003452,"date":"2024-12-27T10:17:24","date_gmt":"2024-12-27T02:17:24","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1003452.html"},"modified":"2024-12-27T10:17:26","modified_gmt":"2024-12-27T02:17:26","slug":"%e5%a6%82%e4%bd%95%e7%94%a8python%e6%95%b0%e6%8d%ae%e6%b8%85%e6%b4%97","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1003452.html","title":{"rendered":"\u5982\u4f55\u7528python\u6570\u636e\u6e05\u6d17"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25080811\/ca1ac17b-2493-4637-bc29-6cde3df3676c.webp\" alt=\"\u5982\u4f55\u7528python\u6570\u636e\u6e05\u6d17\" \/><\/p>\n<p><p> \u5728Python\u4e2d\u8fdb\u884c\u6570\u636e\u6e05\u6d17\u7684\u8fc7\u7a0b\u4e2d\uff0c<strong>\u53ef\u4ee5\u901a\u8fc7\u4f7f\u7528Pandas\u5e93\u3001\u5904\u7406\u7f3a\u5931\u503c\u3001\u6807\u51c6\u5316\u6570\u636e\u3001\u5904\u7406\u5f02\u5e38\u503c\u3001\u8f6c\u6362\u6570\u636e\u7c7b\u578b\u548c\u5408\u5e76\u6570\u636e\u96c6<\/strong>\u7b49\u65b9\u6cd5\u6765\u63d0\u9ad8\u6570\u636e\u8d28\u91cf\u3002\u5176\u4e2d\uff0c<strong>\u4f7f\u7528Pandas\u5e93<\/strong>\u662f\u4e00\u4e2a\u6838\u5fc3\u6b65\u9aa4\uff0c\u56e0\u4e3a\u5b83\u63d0\u4f9b\u4e86\u5f3a\u5927\u7684\u6570\u636e\u64cd\u4f5c\u548c\u5206\u6790\u529f\u80fd\uff0c\u53ef\u4ee5\u5e2e\u52a9\u6211\u4eec\u9ad8\u6548\u5730\u6e05\u6d17\u548c\u5904\u7406\u6570\u636e\u3002<\/p>\n<\/p>\n<p><p>Pandas\u5e93\u662fPython\u4e2d\u6700\u53d7\u6b22\u8fce\u7684\u6570\u636e\u5206\u6790\u5de5\u5177\u4e4b\u4e00\uff0c\u5c24\u5176\u9002\u5408\u7528\u4e8e\u6570\u636e\u6e05\u6d17\u3002\u5b83\u63d0\u4f9b\u4e86DataFrame\u548cSeries\u6570\u636e\u7ed3\u6784\uff0c\u4f7f\u6570\u636e\u7684\u64cd\u4f5c\u66f4\u52a0\u76f4\u89c2\u548c\u65b9\u4fbf\u3002\u901a\u8fc7Pandas\uff0c\u6211\u4eec\u53ef\u4ee5\u8f7b\u677e\u5730\u52a0\u8f7d\u6570\u636e\u96c6\u3001\u68c0\u67e5\u6570\u636e\u3001\u5904\u7406\u7f3a\u5931\u503c\u3001\u8f6c\u6362\u6570\u636e\u7c7b\u578b\u3001\u5904\u7406\u91cd\u590d\u503c\u548c\u5408\u5e76\u4e0d\u540c\u7684\u6570\u636e\u96c6\u3002\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u5c06\u8be6\u7ec6\u63a2\u8ba8\u5982\u4f55\u4f7f\u7528Python\u8fdb\u884c\u6570\u636e\u6e05\u6d17\uff0c\u5e76\u7ed3\u5408\u5177\u4f53\u793a\u4f8b\u6765\u8bf4\u660e\u6bcf\u4e2a\u6b65\u9aa4\u3002<\/p>\n<\/p>\n<p><p>\u4e00\u3001\u4f7f\u7528PANDAS\u5e93<\/p>\n<\/p>\n<p><p>Pandas\u5e93\u662fPython\u4e2d\u7528\u4e8e\u6570\u636e\u5206\u6790\u548c\u6570\u636e\u6e05\u6d17\u7684\u5f3a\u5927\u5de5\u5177\u3002\u5b83\u63d0\u4f9b\u4e86\u7075\u6d3b\u7684\u6570\u636e\u7ed3\u6784\u548c\u4e30\u5bcc\u7684\u6570\u636e\u64cd\u4f5c\u65b9\u6cd5\uff0c\u80fd\u591f\u5e2e\u52a9\u6211\u4eec\u5feb\u901f\u9ad8\u6548\u5730\u8fdb\u884c\u6570\u636e\u6e05\u6d17\u3002<\/p>\n<\/p>\n<ol>\n<li><strong>\u52a0\u8f7d\u6570\u636e<\/strong><\/li>\n<\/ol>\n<p><p>\u5728\u8fdb\u884c\u6570\u636e\u6e05\u6d17\u4e4b\u524d\uff0c\u6211\u4eec\u9996\u5148\u9700\u8981\u5c06\u6570\u636e\u52a0\u8f7d\u5230Pandas\u4e2d\u3002Pandas\u652f\u6301\u591a\u79cd\u6570\u636e\u683c\u5f0f\u7684\u52a0\u8f7d\uff0c\u5305\u62ecCSV\u3001Excel\u3001SQL\u7b49\u3002\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528<code>read_csv<\/code>\u3001<code>read_excel<\/code>\u7b49\u51fd\u6570\u6765\u52a0\u8f7d\u6570\u636e\u96c6\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import pandas as pd<\/p>\n<h2><strong>\u52a0\u8f7dCSV\u6587\u4ef6<\/strong><\/h2>\n<p>data = pd.read_csv(&#39;data.csv&#39;)<\/p>\n<h2><strong>\u52a0\u8f7dExcel\u6587\u4ef6<\/strong><\/h2>\n<p>data = pd.read_excel(&#39;data.xlsx&#39;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"2\">\n<li><strong>\u68c0\u67e5\u6570\u636e<\/strong><\/li>\n<\/ol>\n<p><p>\u52a0\u8f7d\u6570\u636e\u540e\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528Pandas\u7684\u5404\u79cd\u65b9\u6cd5\u6765\u68c0\u67e5\u6570\u636e\u7684\u57fa\u672c\u4fe1\u606f\u3002\u4f8b\u5982\uff0c\u4f7f\u7528<code>head()<\/code>\u65b9\u6cd5\u67e5\u770b\u524d\u51e0\u884c\u6570\u636e\uff0c<code>info()<\/code>\u65b9\u6cd5\u67e5\u770b\u6570\u636e\u7c7b\u578b\u548c\u7f3a\u5931\u503c\u60c5\u51b5\uff0c<code>describe()<\/code>\u65b9\u6cd5\u67e5\u770b\u6570\u636e\u7684\u7edf\u8ba1\u4fe1\u606f\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u67e5\u770b\u6570\u636e\u524d5\u884c<\/p>\n<p>print(data.head())<\/p>\n<h2><strong>\u67e5\u770b\u6570\u636e\u7c7b\u578b\u548c\u7f3a\u5931\u503c<\/strong><\/h2>\n<p>print(data.info())<\/p>\n<h2><strong>\u67e5\u770b\u6570\u636e\u7edf\u8ba1\u4fe1\u606f<\/strong><\/h2>\n<p>print(data.describe())<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4e8c\u3001\u5904\u7406\u7f3a\u5931\u503c<\/p>\n<\/p>\n<p><p>\u6570\u636e\u96c6\u4e2d\u5f80\u5f80\u4f1a\u5b58\u5728\u7f3a\u5931\u503c\uff0c\u5904\u7406\u8fd9\u4e9b\u7f3a\u5931\u503c\u662f\u6570\u636e\u6e05\u6d17\u7684\u91cd\u8981\u6b65\u9aa4\u4e4b\u4e00\u3002\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528Pandas\u63d0\u4f9b\u7684\u65b9\u6cd5\u6765\u8bc6\u522b\u548c\u5904\u7406\u7f3a\u5931\u503c\u3002<\/p>\n<\/p>\n<ol>\n<li><strong>\u8bc6\u522b\u7f3a\u5931\u503c<\/strong><\/li>\n<\/ol>\n<p><p>Pandas\u4e2d\u7684<code>isnull()<\/code>\u548c<code>notnull()<\/code>\u65b9\u6cd5\u53ef\u4ee5\u5e2e\u52a9\u6211\u4eec\u8bc6\u522b\u7f3a\u5931\u503c\u3002<code>isnull()<\/code>\u8fd4\u56de\u4e00\u4e2a\u5e03\u5c14\u503cDataFrame\uff0c\u6307\u793a\u6bcf\u4e2a\u5143\u7d20\u662f\u5426\u4e3a\u7f3a\u5931\u503c\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u8bc6\u522b\u7f3a\u5931\u503c<\/p>\n<p>missing_values = data.isnull()<\/p>\n<p>print(missing_values)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"2\">\n<li><strong>\u586b\u5145\u7f3a\u5931\u503c<\/strong><\/li>\n<\/ol>\n<p><p>\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528<code>fillna()<\/code>\u65b9\u6cd5\u6765\u586b\u5145\u7f3a\u5931\u503c\u3002\u5e38\u7528\u7684\u586b\u5145\u65b9\u6cd5\u5305\u62ec\u4f7f\u7528\u5e38\u6570\u503c\u586b\u5145\u3001\u4f7f\u7528\u5217\u7684\u5747\u503c\u6216\u4e2d\u4f4d\u6570\u586b\u5145\u7b49\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u4f7f\u7528\u5e38\u6570\u586b\u5145<\/p>\n<p>data_filled = data.fillna(0)<\/p>\n<h2><strong>\u4f7f\u7528\u5747\u503c\u586b\u5145<\/strong><\/h2>\n<p>data_filled = data.fillna(data.mean())<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"3\">\n<li><strong>\u5220\u9664\u7f3a\u5931\u503c<\/strong><\/li>\n<\/ol>\n<p><p>\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\uff0c\u5220\u9664\u7f3a\u5931\u503c\u53ef\u80fd\u662f\u66f4\u597d\u7684\u9009\u62e9\u3002\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528<code>dropna()<\/code>\u65b9\u6cd5\u5220\u9664\u5305\u542b\u7f3a\u5931\u503c\u7684\u884c\u6216\u5217\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u5220\u9664\u5305\u542b\u7f3a\u5931\u503c\u7684\u884c<\/p>\n<p>data_dropped = data.dropna()<\/p>\n<h2><strong>\u5220\u9664\u5305\u542b\u7f3a\u5931\u503c\u7684\u5217<\/strong><\/h2>\n<p>data_dropped = data.dropna(axis=1)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4e09\u3001\u6807\u51c6\u5316\u6570\u636e<\/p>\n<\/p>\n<p><p>\u6570\u636e\u6807\u51c6\u5316\u662f\u6570\u636e\u6e05\u6d17\u7684\u91cd\u8981\u6b65\u9aa4\u4e4b\u4e00\uff0c\u5c24\u5176\u5728\u8fdb\u884c<a href=\"https:\/\/docs.pingcode.com\/ask\/59192.html\" target=\"_blank\">\u673a\u5668\u5b66\u4e60<\/a>\u5efa\u6a21\u65f6\uff0c\u6807\u51c6\u5316\u53ef\u4ee5\u63d0\u9ad8\u6a21\u578b\u7684\u6536\u655b\u901f\u5ea6\u548c\u51c6\u786e\u6027\u3002\u6807\u51c6\u5316\u5305\u62ec\u5bf9\u6570\u636e\u8fdb\u884c\u5f52\u4e00\u5316\u548c\u6b63\u5219\u5316\u3002<\/p>\n<\/p>\n<ol>\n<li><strong>\u5f52\u4e00\u5316<\/strong><\/li>\n<\/ol>\n<p><p>\u5f52\u4e00\u5316\u662f\u5c06\u6570\u636e\u7f29\u653e\u5230\u7279\u5b9a\u7684\u8303\u56f4\uff08\u901a\u5e38\u662f0\u52301\uff09\uff0c\u53ef\u4ee5\u4f7f\u7528MinMaxScaler\u8fdb\u884c\u5f52\u4e00\u5316\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from sklearn.preprocessing import MinMaxScaler<\/p>\n<h2><strong>\u521d\u59cb\u5316MinMaxScaler<\/strong><\/h2>\n<p>scaler = MinMaxScaler()<\/p>\n<h2><strong>\u5bf9\u6570\u636e\u8fdb\u884c\u5f52\u4e00\u5316<\/strong><\/h2>\n<p>data_normalized = scaler.fit_transform(data)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"2\">\n<li><strong>\u6b63\u5219\u5316<\/strong><\/li>\n<\/ol>\n<p><p>\u6b63\u5219\u5316\u662f\u5c06\u6570\u636e\u8f6c\u6362\u4e3a\u5355\u4f4d\u5411\u91cf\uff0c\u4f7f\u6570\u636e\u7684\u8303\u6570\u4e3a1\uff0c\u5e38\u7528\u7684\u65b9\u6cd5\u662fL2\u6b63\u5219\u5316\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from sklearn.preprocessing import normalize<\/p>\n<h2><strong>\u5bf9\u6570\u636e\u8fdb\u884cL2\u6b63\u5219\u5316<\/strong><\/h2>\n<p>data_normalized = normalize(data, norm=&#39;l2&#39;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u56db\u3001\u5904\u7406\u5f02\u5e38\u503c<\/p>\n<\/p>\n<p><p>\u5f02\u5e38\u503c\u662f\u6570\u636e\u96c6\u4e2d\u504f\u79bb\u6b63\u5e38\u8303\u56f4\u7684\u503c\uff0c\u53ef\u80fd\u5bf9\u5206\u6790\u7ed3\u679c\u4ea7\u751f\u4e0d\u5229\u5f71\u54cd\u3002\u5904\u7406\u5f02\u5e38\u503c\u662f\u6570\u636e\u6e05\u6d17\u7684\u91cd\u8981\u6b65\u9aa4\u4e4b\u4e00\u3002<\/p>\n<\/p>\n<ol>\n<li><strong>\u8bc6\u522b\u5f02\u5e38\u503c<\/strong><\/li>\n<\/ol>\n<p><p>\u5e38\u7528\u7684\u8bc6\u522b\u5f02\u5e38\u503c\u7684\u65b9\u6cd5\u5305\u62ec\u7bb1\u7ebf\u56fe\u3001Z-score\u7b49\u3002\u901a\u8fc7\u8fd9\u4e9b\u65b9\u6cd5\uff0c\u6211\u4eec\u53ef\u4ee5\u8bc6\u522b\u51fa\u6570\u636e\u4e2d\u7684\u5f02\u5e38\u503c\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import numpy as np<\/p>\n<h2><strong>\u4f7f\u7528Z-score\u8bc6\u522b\u5f02\u5e38\u503c<\/strong><\/h2>\n<p>z_scores = np.abs((data - data.mean()) \/ data.std())<\/p>\n<p>outliers = z_scores &gt; 3<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"2\">\n<li><strong>\u5904\u7406\u5f02\u5e38\u503c<\/strong><\/li>\n<\/ol>\n<p><p>\u5904\u7406\u5f02\u5e38\u503c\u7684\u65b9\u6cd5\u5305\u62ec\u5220\u9664\u5f02\u5e38\u503c\u3001\u66ff\u6362\u5f02\u5e38\u503c\u7b49\u3002\u6211\u4eec\u53ef\u4ee5\u6839\u636e\u5177\u4f53\u60c5\u51b5\u9009\u62e9\u5408\u9002\u7684\u65b9\u6cd5\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u5220\u9664\u5f02\u5e38\u503c<\/p>\n<p>data_no_outliers = data[(z_scores &lt; 3).all(axis=1)]<\/p>\n<h2><strong>\u66ff\u6362\u5f02\u5e38\u503c<\/strong><\/h2>\n<p>data_replaced_outliers = data.copy()<\/p>\n<p>data_replaced_outliers[outliers] = data.median()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4e94\u3001\u8f6c\u6362\u6570\u636e\u7c7b\u578b<\/p>\n<\/p>\n<p><p>\u6570\u636e\u7c7b\u578b\u8f6c\u6362\u662f\u6570\u636e\u6e05\u6d17\u7684\u91cd\u8981\u6b65\u9aa4\u4e4b\u4e00\uff0c\u5c24\u5176\u5728\u5904\u7406\u4e0d\u540c\u6570\u636e\u6e90\u65f6\uff0c\u6570\u636e\u7c7b\u578b\u53ef\u80fd\u4e0d\u4e00\u81f4\u3002\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528Pandas\u63d0\u4f9b\u7684\u65b9\u6cd5\u6765\u8f6c\u6362\u6570\u636e\u7c7b\u578b\u3002<\/p>\n<\/p>\n<ol>\n<li><strong>\u8f6c\u6362\u4e3a\u6570\u503c\u7c7b\u578b<\/strong><\/li>\n<\/ol>\n<p><p>\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528<code>astype()<\/code>\u65b9\u6cd5\u5c06\u6570\u636e\u8f6c\u6362\u4e3a\u6570\u503c\u7c7b\u578b\uff0c\u5982\u6574\u6570\u6216\u6d6e\u70b9\u6570\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u8f6c\u6362\u4e3a\u6574\u6570<\/p>\n<p>data[&#39;column&#39;] = data[&#39;column&#39;].astype(int)<\/p>\n<h2><strong>\u8f6c\u6362\u4e3a\u6d6e\u70b9\u6570<\/strong><\/h2>\n<p>data[&#39;column&#39;] = data[&#39;column&#39;].astype(float)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"2\">\n<li><strong>\u5904\u7406\u65e5\u671f\u65f6\u95f4\u7c7b\u578b<\/strong><\/li>\n<\/ol>\n<p><p>Pandas\u63d0\u4f9b\u4e86<code>to_datetime()<\/code>\u65b9\u6cd5\uff0c\u53ef\u4ee5\u5c06\u5b57\u7b26\u4e32\u683c\u5f0f\u7684\u65e5\u671f\u65f6\u95f4\u8f6c\u6362\u4e3aPandas\u7684Datetime\u7c7b\u578b\uff0c\u4fbf\u4e8e\u540e\u7eed\u7684\u65f6\u95f4\u5e8f\u5217\u5206\u6790\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u8f6c\u6362\u4e3a\u65e5\u671f\u65f6\u95f4\u7c7b\u578b<\/p>\n<p>data[&#39;date&#39;] = pd.to_datetime(data[&#39;date&#39;])<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u516d\u3001\u5408\u5e76\u6570\u636e\u96c6<\/p>\n<\/p>\n<p><p>\u5728\u8fdb\u884c\u6570\u636e\u5206\u6790\u65f6\uff0c\u6211\u4eec\u53ef\u80fd\u9700\u8981\u5c06\u591a\u4e2a\u6570\u636e\u96c6\u8fdb\u884c\u5408\u5e76\uff0cPandas\u63d0\u4f9b\u4e86<code>merge()<\/code>\u3001<code>concat()<\/code>\u7b49\u65b9\u6cd5\uff0c\u4fbf\u4e8e\u6570\u636e\u96c6\u7684\u5408\u5e76\u3002<\/p>\n<\/p>\n<ol>\n<li><strong>\u5408\u5e76\u6570\u636e<\/strong><\/li>\n<\/ol>\n<p><p>\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528<code>merge()<\/code>\u65b9\u6cd5\u6839\u636e\u67d0\u4e00\u5217\u6216\u591a\u5217\u5c06\u6570\u636e\u96c6\u8fdb\u884c\u5408\u5e76\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u6839\u636e\u67d0\u4e00\u5217\u8fdb\u884c\u5408\u5e76<\/p>\n<p>merged_data = pd.merge(data1, data2, on=&#39;key&#39;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"2\">\n<li><strong>\u8fde\u63a5\u6570\u636e<\/strong><\/li>\n<\/ol>\n<p><p>\u4f7f\u7528<code>concat()<\/code>\u65b9\u6cd5\u53ef\u4ee5\u5c06\u591a\u4e2a\u6570\u636e\u96c6\u8fdb\u884c\u4e0a\u4e0b\u6216\u5de6\u53f3\u8fde\u63a5\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u4e0a\u4e0b\u8fde\u63a5<\/p>\n<p>concatenated_data = pd.concat([data1, data2], axis=0)<\/p>\n<h2><strong>\u5de6\u53f3\u8fde\u63a5<\/strong><\/h2>\n<p>concatenated_data = pd.concat([data1, data2], axis=1)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u901a\u8fc7\u4ee5\u4e0a\u6b65\u9aa4\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528Python\u4e2d\u7684Pandas\u5e93\u8fdb\u884c\u6570\u636e\u6e05\u6d17\u3002\u6570\u636e\u6e05\u6d17\u662f\u6570\u636e\u5206\u6790\u548c\u673a\u5668\u5b66\u4e60\u4e2d\u7684\u91cd\u8981\u73af\u8282\uff0c\u80fd\u591f\u5e2e\u52a9\u6211\u4eec\u63d0\u9ad8\u6570\u636e\u8d28\u91cf\uff0c\u4ece\u800c\u83b7\u5f97\u66f4\u51c6\u786e\u7684\u5206\u6790\u7ed3\u679c\u548c\u66f4\u4f18\u7684\u6a21\u578b\u6027\u80fd\u3002\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0c\u6211\u4eec\u9700\u8981\u6839\u636e\u5177\u4f53\u7684\u6570\u636e\u96c6\u548c\u5206\u6790\u76ee\u6807\uff0c\u7075\u6d3b\u8fd0\u7528\u8fd9\u4e9b\u65b9\u6cd5\uff0c\u4ee5\u8fbe\u5230\u6700\u4f73\u7684\u6570\u636e\u6e05\u6d17\u6548\u679c\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5f00\u59cb\u8fdb\u884cPython\u6570\u636e\u6e05\u6d17\u7684\u57fa\u672c\u6b65\u9aa4\u662f\u4ec0\u4e48\uff1f<\/strong><br \/>\u5728\u8fdb\u884cPython\u6570\u636e\u6e05\u6d17\u65f6\uff0c\u901a\u5e38\u9700\u8981\u9075\u5faa\u51e0\u4e2a\u6b65\u9aa4\u3002\u9996\u5148\uff0c\u5bfc\u5165\u5fc5\u8981\u7684\u5e93\uff0c\u5982Pandas\u548cNumPy\u3002\u8fd9\u4e9b\u5e93\u63d0\u4f9b\u4e86\u5f3a\u5927\u7684\u6570\u636e\u5904\u7406\u529f\u80fd\u3002\u63a5\u4e0b\u6765\uff0c\u52a0\u8f7d\u6570\u636e\u96c6\u5e76\u8fdb\u884c\u521d\u6b65\u63a2\u7d22\uff0c\u4ee5\u8bc6\u522b\u7f3a\u5931\u503c\u3001\u91cd\u590d\u8bb0\u5f55\u548c\u5f02\u5e38\u503c\u3002\u5728\u53d1\u73b0\u95ee\u9898\u540e\uff0c\u4f7f\u7528Pandas\u7684\u5185\u7f6e\u51fd\u6570\u8fdb\u884c\u6570\u636e\u5904\u7406\uff0c\u4f8b\u5982\u586b\u8865\u7f3a\u5931\u503c\u3001\u5220\u9664\u91cd\u590d\u9879\u4ee5\u53ca\u5bf9\u5f02\u5e38\u503c\u8fdb\u884c\u5904\u7406\u3002\u6700\u540e\uff0c\u786e\u4fdd\u6570\u636e\u683c\u5f0f\u6b63\u786e\uff0c\u5e76\u4fdd\u5b58\u6e05\u6d17\u540e\u7684\u6570\u636e\u4ee5\u5907\u540e\u7eed\u5206\u6790\u3002<\/p>\n<p><strong>Python\u4e2d\u6709\u54ea\u4e9b\u5e38\u7528\u7684\u5e93\u53ef\u4ee5\u5e2e\u52a9\u8fdb\u884c\u6570\u636e\u6e05\u6d17\uff1f<\/strong><br \/>\u5728Python\u4e2d\uff0c\u6709\u51e0\u4e2a\u5e7f\u6cdb\u4f7f\u7528\u7684\u5e93\u4e13\u95e8\u7528\u4e8e\u6570\u636e\u6e05\u6d17\u3002Pandas\u662f\u6700\u5e38\u7528\u7684\u5de5\u5177\uff0c\u5b83\u63d0\u4f9b\u4e86\u4e30\u5bcc\u7684\u6570\u636e\u7ed3\u6784\u548c\u64cd\u4f5c\u65b9\u6cd5\uff0c\u7279\u522b\u9002\u5408\u5904\u7406\u8868\u683c\u6570\u636e\u3002NumPy\u5219\u4e3b\u8981\u7528\u4e8e\u6570\u503c\u8ba1\u7b97\uff0c\u53ef\u4ee5\u5e2e\u52a9\u5904\u7406\u6570\u7ec4\u548c\u77e9\u9635\u6570\u636e\u3002\u9664\u6b64\u4e4b\u5916\uff0cOpenRefine\u662f\u4e00\u4e2a\u72ec\u7acb\u7684\u5de5\u5177\uff0c\u5c3d\u7ba1\u5b83\u4e0d\u662fPython\u5e93\uff0c\u4f46\u53ef\u4ee5\u4e0ePython\u7ed3\u5408\u4f7f\u7528\uff0c\u7279\u522b\u9002\u5408\u5904\u7406\u5927\u89c4\u6a21\u7684\u6570\u636e\u6e05\u6d17\u4efb\u52a1\u3002<\/p>\n<p><strong>\u5982\u4f55\u5904\u7406\u6570\u636e\u4e2d\u7684\u7f3a\u5931\u503c\uff1f<\/strong><br \/>\u5904\u7406\u7f3a\u5931\u503c\u662f\u6570\u636e\u6e05\u6d17\u4e2d\u7684\u4e00\u9879\u91cd\u8981\u5de5\u4f5c\u3002\u5728Python\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528Pandas\u5e93\u63d0\u4f9b\u7684\u65b9\u6cd5\u6765\u8bc6\u522b\u548c\u5904\u7406\u7f3a\u5931\u503c\u3002\u5e38\u89c1\u7684\u5904\u7406\u65b9\u5f0f\u5305\u62ec\u586b\u5145\u7f3a\u5931\u503c\uff08\u5982\u4f7f\u7528\u5747\u503c\u3001\u4e2d\u4f4d\u6570\u6216\u4f17\u6570\uff09\uff0c\u5220\u9664\u5305\u542b\u7f3a\u5931\u503c\u7684\u884c\u6216\u5217\uff0c\u6216\u8005\u4f7f\u7528\u63d2\u503c\u65b9\u6cd5\u6765<a href=\"https:\/\/docs.pingcode.com\/agile\/project-management\/estimation\" target=\"_blank\">\u4f30\u7b97<\/a>\u7f3a\u5931\u503c\u3002\u9009\u62e9\u5408\u9002\u7684\u65b9\u6cd5\u53d6\u51b3\u4e8e\u6570\u636e\u7684\u6027\u8d28\u548c\u5206\u6790\u9700\u6c42\uff0c\u4e86\u89e3\u6bcf\u79cd\u65b9\u6cd5\u7684\u4f18\u7f3a\u70b9\u5c06\u6709\u52a9\u4e8e\u505a\u51fa\u66f4\u597d\u7684\u51b3\u7b56\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u5728Python\u4e2d\u8fdb\u884c\u6570\u636e\u6e05\u6d17\u7684\u8fc7\u7a0b\u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7\u4f7f\u7528Pandas\u5e93\u3001\u5904\u7406\u7f3a\u5931\u503c\u3001\u6807\u51c6\u5316\u6570\u636e\u3001\u5904\u7406\u5f02\u5e38\u503c\u3001\u8f6c\u6362\u6570\u636e [&hellip;]","protected":false},"author":3,"featured_media":1003457,"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\/1003452"}],"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=1003452"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1003452\/revisions"}],"predecessor-version":[{"id":1003460,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1003452\/revisions\/1003460"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1003457"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1003452"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1003452"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1003452"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}