{"id":2421,"date":"2023-07-22T08:36:27","date_gmt":"2023-07-22T08:36:27","guid":{"rendered":"https:\/\/statorials.org\/cn\/pandas%e6%95%b0%e6%8d%ae%e8%bd%ac%e6%8d%a2%e4%b8%ba%e5%af%b9%e8%b1%a1%e7%9a%84numpy-dtype%e6%a3%80%e6%9f%a5%e8%be%93%e5%85%a5%e6%95%b0%e6%8d%ae%e4%b8%8enp-asarraydata\/"},"modified":"2023-07-22T08:36:27","modified_gmt":"2023-07-22T08:36:27","slug":"pandas%e6%95%b0%e6%8d%ae%e8%bd%ac%e6%8d%a2%e4%b8%ba%e5%af%b9%e8%b1%a1%e7%9a%84numpy-dtype%e6%a3%80%e6%9f%a5%e8%be%93%e5%85%a5%e6%95%b0%e6%8d%ae%e4%b8%8enp-asarraydata","status":"publish","type":"post","link":"https:\/\/statorials.org\/cn\/pandas%e6%95%b0%e6%8d%ae%e8%bd%ac%e6%8d%a2%e4%b8%ba%e5%af%b9%e8%b1%a1%e7%9a%84numpy-dtype%e6%a3%80%e6%9f%a5%e8%be%93%e5%85%a5%e6%95%b0%e6%8d%ae%e4%b8%8enp-asarraydata\/","title":{"rendered":"\u5982\u4f55\u4fee\u590d\uff1apandas \u6570\u636e\u8f6c\u6362\u4e3a numpy \u5bf9\u8c61\u7c7b\u578b\u3002\u4f7f\u7528 np.asarray(data) \u68c0\u67e5\u8f93\u5165\u6570\u636e\u3002"},"content":{"rendered":"<p><\/p>\n<hr>\n<p><span style=\"color: #000000;\">\u4f7f\u7528Python\u65f6\u53ef\u80fd\u4f1a\u9047\u5230\u7684\u9519\u8bef\u662f\uff1a<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #ff0000;\">ValueError<\/span> : Pandas data cast to numpy dtype of object. Check input data with\nnp.asarray(data).\n<\/strong><\/pre>\n<p><span style=\"color: #000000;\">\u5f53\u60a8\u5c1d\u8bd5\u5728 Python \u4e2d\u62df\u5408\u56de\u5f52\u6a21\u578b\u5e76\u4e14\u5728\u62df\u5408\u6a21\u578b\u4e4b\u524d\u65e0\u6cd5\u5c06 calcategori \u53d8\u91cf\u8f6c\u6362\u4e3a<a href=\"https:\/\/statorials.org\/cn\/\u56de\u5f52\u865a\u62df\u53d8\u91cf\/\" target=\"_blank\" rel=\"noopener\">\u865a\u62df\u53d8\u91cf<\/a>\u65f6\uff0c\u4f1a\u51fa\u73b0\u6b64\u9519\u8bef\u3002<\/span><\/p>\n<p><span style=\"color: #000000;\">\u4ee5\u4e0b\u793a\u4f8b\u5c55\u793a\u4e86\u5982\u4f55\u5728\u5b9e\u8df5\u4e2d\u7ea0\u6b63\u6b64\u9519\u8bef\u3002<\/span><\/p>\n<h3><span style=\"color: #000000;\"><strong>\u5982\u4f55\u91cd\u73b0\u9519\u8bef<\/strong><\/span><\/h3>\n<p><span style=\"color: #000000;\">\u5047\u8bbe\u6211\u4eec\u6709\u4ee5\u4e0b pandas DataFrame\uff1a<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #008080;\"><span style=\"color: #000000;\"><span style=\"color: #008000;\">import<\/span> pandas <span style=\"color: #008000;\">as<\/span> pd\n\n<span style=\"color: #008080;\">#createDataFrame\n<\/span>df = pd. <span style=\"color: #3366ff;\">DataFrame<\/span> ({' <span style=\"color: #ff0000;\">team<\/span> ': ['A', 'A', 'A', 'A', 'B', 'B', 'B', 'B'],\n                   ' <span style=\"color: #ff0000;\">assists<\/span> ': [5, 7, 7, 9, 12, 9, 9, 4],\n                   ' <span style=\"color: #ff0000;\">rebounds<\/span> ': [11, 8, 10, 6, 6, 5, 9, 12],\n                   ' <span style=\"color: #ff0000;\">points<\/span> ': [14, 19, 8, 12, 17, 19, 22, 25]})\n\n<span style=\"color: #008080;\">#view DataFrame\n<\/span>df\n\n\tteam assists rebounds points\n0 A 5 11 14\n1 To 7 8 19\n2 A 7 10 8\n3 to 9 6 12\n4 B 12 6 17\n5 B 9 5 19\n6 B 9 9 22\n7 B 4 12 25<\/span><\/span><\/strong><\/pre>\n<p><span style=\"color: #000000;\">\u73b0\u5728\u5047\u8bbe\u6211\u4eec\u5c1d\u8bd5\u4f7f\u7528\u56e2\u961f\u3001\u52a9\u653b\u548c\u7bee\u677f\u4f5c\u4e3a\u9884\u6d4b\u53d8\u91cf\uff0c\u5e76\u4f7f\u7528\u5f97\u5206\u4f5c\u4e3a<a href=\"https:\/\/statorials.org\/cn\/\u53d8\u91cf\u89e3\u91ca\u6027\u53cd\u5e94\/\" target=\"_blank\" rel=\"noopener\">\u54cd\u5e94\u53d8\u91cf<\/a>\u6765\u62df\u5408<a href=\"https:\/\/statorials.org\/cn\/\u591a\u5143\u7ebf\u6027\u56de\u5f52-1\/\" target=\"_blank\" rel=\"noopener\">\u591a\u5143\u7ebf\u6027\u56de\u5f52\u6a21\u578b<\/a>\uff1a<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #008080;\"><span style=\"color: #000000;\"><span style=\"color: #008000;\">import<\/span> statsmodels. <span style=\"color: #3366ff;\">api<\/span> <span style=\"color: #008000;\">as<\/span> sm\n\n<span style=\"color: #008080;\">#define response variable\n<\/span>y = df['points']\n\n<span style=\"color: #008080;\">#define predictor variables\n<\/span>x = df[['team', 'assists', 'rebounds']]\n\n<span style=\"color: #008080;\">#add constant to predictor variables\n<\/span>x = sm. <span style=\"color: #3366ff;\">add_constant<\/span> (x)\n\n<span style=\"color: #008080;\">#attempt to fit regression model\n<\/span>model = sm. <span style=\"color: #3366ff;\">OLS<\/span> (y,x). <span style=\"color: #3366ff;\">fit<\/span> ()\n\n<span style=\"color: #ff0000;\">ValueError<\/span> : Pandas data cast to numpy dtype of object. Check input data with\nnp.asarray(data).\n<\/span><\/span><\/strong><\/pre>\n<p><span style=\"color: #000000;\">\u6211\u4eec\u6536\u5230\u9519\u8bef\uff0c\u56e0\u4e3a\u201c\u56e2\u961f\u201d\u53d8\u91cf\u662f\u5206\u7c7b\u53d8\u91cf\uff0c\u5e76\u4e14\u5728\u62df\u5408\u56de\u5f52\u6a21\u578b\u4e4b\u524d\u6211\u4eec\u6ca1\u6709\u5c06\u5176\u8f6c\u6362\u4e3a\u865a\u62df\u53d8\u91cf\u3002<\/span><\/p>\n<h3><span style=\"color: #000000;\"><strong>\u5982\u4f55\u4fee\u590d\u9519\u8bef<\/strong><\/span><\/h3>\n<p><span style=\"color: #000000;\">\u4fee\u590d\u6b64\u9519\u8bef\u7684\u6700\u7b80\u5355\u65b9\u6cd5\u662f\u4f7f\u7528<a href=\"https:\/\/pandas.pydata.org\/docs\/reference\/api\/pandas.get_dummies.html\" target=\"_blank\" rel=\"noopener\">pandas.get_dummies()<\/a>\u51fd\u6570\u5c06\u201cteam\u201d\u53d8\u91cf\u8f6c\u6362\u4e3a\u865a\u62df\u53d8\u91cf\u3002<\/span><\/p>\n<p><span style=\"color: #000000;\"><strong>\u6ce8\u610f<\/strong>\uff1a\u67e5\u770b<a href=\"https:\/\/statorials.org\/cn\/\u718a\u732b\u6210\u4e3a\u6a21\u7279\/\" target=\"_blank\" rel=\"noopener\">\u672c\u6559\u7a0b<\/a>\uff0c\u5feb\u901f\u56de\u987e\u4e00\u4e0b\u56de\u5f52\u6a21\u578b\u4e2d\u7684\u865a\u62df\u53d8\u91cf\u3002<\/span><\/p>\n<p><span style=\"color: #000000;\">\u4ee5\u4e0b\u4ee3\u7801\u663e\u793a\u4e86\u5982\u4f55\u5c06\u201cteam\u201d\u8f6c\u6362\u4e3a\u865a\u62df\u53d8\u91cf\uff1a<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #008080;\"><span style=\"color: #000000;\"><span style=\"color: #008000;\">import<\/span> pandas <span style=\"color: #008000;\">as<\/span> pd\n\n<span style=\"color: #008080;\">#createDataFrame\n<\/span>df = pd. <span style=\"color: #3366ff;\">DataFrame<\/span> ({' <span style=\"color: #ff0000;\">team<\/span> ': ['A', 'A', 'A', 'A', 'B', 'B', 'B', 'B'],\n                   ' <span style=\"color: #ff0000;\">assists<\/span> ': [5, 7, 7, 9, 12, 9, 9, 4],\n                   ' <span style=\"color: #ff0000;\">rebounds<\/span> ': [11, 8, 10, 6, 6, 5, 9, 12],\n                   ' <span style=\"color: #ff0000;\">points<\/span> ': [14, 19, 8, 12, 17, 19, 22, 25]})\n\n<span style=\"color: #008080;\">#convert \"team\" to dummy variable\n<\/span>df = pd. <span style=\"color: #3366ff;\">get_dummies<\/span> (df, columns=[' <span style=\"color: #ff0000;\">team<\/span> '], drop_first= <span style=\"color: #008000;\">True<\/span> )\n\n<span style=\"color: #008080;\">#view updated DataFrame\n<\/span>df\n\n        assists rebounds points team_B\n0 5 11 14 0\n1 7 8 19 0\n2 7 10 8 0\n3 9 6 12 0\n4 12 6 17 1\n5 9 5 19 1\n6 9 9 22 1\n7 4 12 25 1<\/span><\/span><\/strong><\/pre>\n<p> <span style=\"color: #000000;\"><span style=\"color: #000000;\">\u201cteam\u201d\u5217\u4e2d\u7684\u503c\u5df2\u4ece\u201cA\u201d\u548c\u201cB\u201d\u8f6c\u6362\u4e3a0\u548c1\u3002<\/span><\/span><\/p>\n<p><span style=\"color: #000000;\">\u6211\u4eec\u73b0\u5728\u53ef\u4ee5\u4f7f\u7528\u65b0\u53d8\u91cf\u201cteam_B\u201d\u62df\u5408\u591a\u5143\u7ebf\u6027\u56de\u5f52\u6a21\u578b\uff1a<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #008080;\"><span style=\"color: #000000;\"><span style=\"color: #008000;\">import<\/span> statsmodels. <span style=\"color: #3366ff;\">api<\/span> <span style=\"color: #008000;\">as<\/span> sm\n\n<span style=\"color: #008080;\">#define response variable\n<\/span>y = df['points']\n\n<span style=\"color: #008080;\">#define predictor variables\n<\/span>x = df[['team_B', 'assists', 'rebounds']]\n\n<span style=\"color: #008080;\">#add constant to predictor variables\n<\/span>x = sm. <span style=\"color: #3366ff;\">add_constant<\/span> (x)\n\n<span style=\"color: #008080;\">#fit regression model\n<\/span>model = sm. <span style=\"color: #3366ff;\">OLS<\/span> (y,x). <span style=\"color: #3366ff;\">fit<\/span> ()\n\n<span style=\"color: #008080;\">#view summary of model fit\n<\/span><span style=\"color: #008000;\">print<\/span> ( <span style=\"color: #3366ff;\">model.summary<\/span> ())\n\n                            OLS Regression Results                            \n==================================================== ============================\nDept. Variable: R-squared points: 0.701\nModel: OLS Adj. R-squared: 0.476\nMethod: Least Squares F-statistic: 3.119\nDate: Thu, 11 Nov 2021 Prob (F-statistic): 0.150\nTime: 14:49:53 Log-Likelihood: -19.637\nNo. Observations: 8 AIC: 47.27\nDf Residuals: 4 BIC: 47.59\nDf Model: 3                                         \nCovariance Type: non-robust                                         \n==================================================== ============================\n                 coef std err t P&gt;|t| [0.025 0.975]\n-------------------------------------------------- ----------------------------\nconst 27.1891 17.058 1.594 0.186 -20.171 74.549\nteam_B 9.1288 3.032 3.010 0.040 0.709 17.548\nassists -1.3445 1.148 -1.171 0.307 -4.532 1.843\nrebounds -0.5174 1.099 -0.471 0.662 -3.569 2.534\n==================================================== ============================\nOmnibus: 0.691 Durbin-Watson: 3.075\nProb(Omnibus): 0.708 Jarque-Bera (JB): 0.145\nSkew: 0.294 Prob(JB): 0.930\nKurtosis: 2.698 Cond. No. 140.\n==================================================== ============================\n<\/span><\/span><\/strong><\/pre>\n<p><span style=\"color: #000000;\">\u8bf7\u6ce8\u610f\uff0c\u8fd9\u6b21\u6211\u4eec\u80fd\u591f\u62df\u5408\u56de\u5f52\u6a21\u578b\uff0c\u6ca1\u6709\u4efb\u4f55\u9519\u8bef\u3002<\/span><\/p>\n<p><span style=\"color: #000000;\"><strong>\u6ce8\u610f<\/strong>\uff1a\u60a8\u53ef\u4ee5\u5728<a href=\"https:\/\/www.statsmodels.org\/dev\/examples\/notebooks\/generated\/ols.html\" target=\"_blank\" rel=\"noopener\">\u6b64\u5904\u7684<\/a>statsmodels \u5e93\u4e2d\u627e\u5230<strong>ols()<\/strong>\u51fd\u6570\u7684\u5b8c\u6574\u6587\u6863\u3002<\/span><\/p>\n<h3><span style=\"color: #000000;\"><strong>\u5176\u4ed6\u8d44\u6e90<\/strong><\/span><\/h3>\n<p><span style=\"color: #000000;\">\u4ee5\u4e0b\u6559\u7a0b\u89e3\u91ca\u4e86\u5982\u4f55\u4fee\u590d Python \u4e2d\u7684\u5176\u4ed6\u5e38\u89c1\u9519\u8bef\uff1a<\/span><\/p>\n<p><a href=\"https:\/\/statorials.org\/cn\/\u718a\u732b\u5173\u952e\u9519\u8bef\/\" target=\"_blank\" rel=\"noopener\">\u5982\u4f55\u4fee\u590d Pandas \u4e2d\u7684 KeyError<\/a><br \/> <a href=\"https:\/\/statorials.org\/cn\/valueerror-\u65e0\u6cd5\u5c06-float-nan-\u8f6c\u6362\u4e3a\u6574\u6570\/\" target=\"_blank\" rel=\"noopener\">\u5982\u4f55\u4fee\u590d\uff1aValueError\uff1a\u65e0\u6cd5\u5c06 float NaN \u8f6c\u6362\u4e3a int<\/a><br \/> <a href=\"https:\/\/statorials.org\/cn\/\u64cd\u4f5c\u6570\u65e0\u6cd5\u7528\u4ee5\u4e0b\u5f62\u5f0f\u5e7f\u64ad\/\" target=\"_blank\" rel=\"noopener\">\u5982\u4f55\u4fee\u590d\uff1aValueError\uff1a\u64cd\u4f5c\u6570\u65e0\u6cd5\u4e0e\u5f62\u72b6\u4e00\u8d77\u5e7f\u64ad<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4f7f\u7528Python\u65f6\u53ef\u80fd\u4f1a\u9047\u5230\u7684\u9519\u8bef\u662f\uff1a ValueError : Pandas data cast to nu [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[],"class_list":["post-2421","post","type-post","status-publish","format-standard","hentry","category-11"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u5982\u4f55\u4fee\u590d\uff1apandas \u6570\u636e\u8f6c\u6362\u4e3a numpy \u5bf9\u8c61\u7c7b\u578b\u3002\u4f7f\u7528 np.asarray(data) \u68c0\u67e5\u8f93\u5165\u6570\u636e\u3002 - Statorials<\/title>\n<meta name=\"description\" content=\"\u672c\u6559\u7a0b\u4ecb\u7ecd\u5982\u4f55\u4fee\u590d\u4ee5\u4e0b\u9519\u8bef\uff1apandas \u6570\u636e\u8f6c\u6362\u4e3a numpy \u5bf9\u8c61\u7c7b\u578b\u3002\u4f7f\u7528 np.asarray(data) \u68c0\u67e5\u8f93\u5165\u6570\u636e\u3002\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/statorials.org\/cn\/pandas\u6570\u636e\u8f6c\u6362\u4e3a\u5bf9\u8c61\u7684numpy-dtype\u68c0\u67e5\u8f93\u5165\u6570\u636e\u4e0enp-asarraydata\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u5982\u4f55\u4fee\u590d\uff1apandas \u6570\u636e\u8f6c\u6362\u4e3a numpy \u5bf9\u8c61\u7c7b\u578b\u3002\u4f7f\u7528 np.asarray(data) \u68c0\u67e5\u8f93\u5165\u6570\u636e\u3002 - Statorials\" \/>\n<meta property=\"og:description\" content=\"\u672c\u6559\u7a0b\u4ecb\u7ecd\u5982\u4f55\u4fee\u590d\u4ee5\u4e0b\u9519\u8bef\uff1apandas \u6570\u636e\u8f6c\u6362\u4e3a numpy \u5bf9\u8c61\u7c7b\u578b\u3002\u4f7f\u7528 np.asarray(data) \u68c0\u67e5\u8f93\u5165\u6570\u636e\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/statorials.org\/cn\/pandas\u6570\u636e\u8f6c\u6362\u4e3a\u5bf9\u8c61\u7684numpy-dtype\u68c0\u67e5\u8f93\u5165\u6570\u636e\u4e0enp-asarraydata\/\" \/>\n<meta property=\"og:site_name\" content=\"Statorials\" \/>\n<meta property=\"article:published_time\" content=\"2023-07-22T08:36:27+00:00\" \/>\n<meta name=\"author\" content=\"\u672c\u6770\u660e\u00b7\u5b89\u5fb7\u68ee\u535a\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u672c\u6770\u660e\u00b7\u5b89\u5fb7\u68ee\u535a\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/statorials.org\/cn\/pandas%e6%95%b0%e6%8d%ae%e8%bd%ac%e6%8d%a2%e4%b8%ba%e5%af%b9%e8%b1%a1%e7%9a%84numpy-dtype%e6%a3%80%e6%9f%a5%e8%be%93%e5%85%a5%e6%95%b0%e6%8d%ae%e4%b8%8enp-asarraydata\/\",\"url\":\"https:\/\/statorials.org\/cn\/pandas%e6%95%b0%e6%8d%ae%e8%bd%ac%e6%8d%a2%e4%b8%ba%e5%af%b9%e8%b1%a1%e7%9a%84numpy-dtype%e6%a3%80%e6%9f%a5%e8%be%93%e5%85%a5%e6%95%b0%e6%8d%ae%e4%b8%8enp-asarraydata\/\",\"name\":\"\u5982\u4f55\u4fee\u590d\uff1apandas \u6570\u636e\u8f6c\u6362\u4e3a numpy \u5bf9\u8c61\u7c7b\u578b\u3002\u4f7f\u7528 np.asarray(data) \u68c0\u67e5\u8f93\u5165\u6570\u636e\u3002 - Statorials\",\"isPartOf\":{\"@id\":\"https:\/\/statorials.org\/cn\/#website\"},\"datePublished\":\"2023-07-22T08:36:27+00:00\",\"dateModified\":\"2023-07-22T08:36:27+00:00\",\"author\":{\"@id\":\"https:\/\/statorials.org\/cn\/#\/schema\/person\/124e4e5b7c9f8dc0f1f95cc8c1db3261\"},\"description\":\"\u672c\u6559\u7a0b\u4ecb\u7ecd\u5982\u4f55\u4fee\u590d\u4ee5\u4e0b\u9519\u8bef\uff1apandas \u6570\u636e\u8f6c\u6362\u4e3a numpy \u5bf9\u8c61\u7c7b\u578b\u3002\u4f7f\u7528 np.asarray(data) \u68c0\u67e5\u8f93\u5165\u6570\u636e\u3002\",\"breadcrumb\":{\"@id\":\"https:\/\/statorials.org\/cn\/pandas%e6%95%b0%e6%8d%ae%e8%bd%ac%e6%8d%a2%e4%b8%ba%e5%af%b9%e8%b1%a1%e7%9a%84numpy-dtype%e6%a3%80%e6%9f%a5%e8%be%93%e5%85%a5%e6%95%b0%e6%8d%ae%e4%b8%8enp-asarraydata\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/statorials.org\/cn\/pandas%e6%95%b0%e6%8d%ae%e8%bd%ac%e6%8d%a2%e4%b8%ba%e5%af%b9%e8%b1%a1%e7%9a%84numpy-dtype%e6%a3%80%e6%9f%a5%e8%be%93%e5%85%a5%e6%95%b0%e6%8d%ae%e4%b8%8enp-asarraydata\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/statorials.org\/cn\/pandas%e6%95%b0%e6%8d%ae%e8%bd%ac%e6%8d%a2%e4%b8%ba%e5%af%b9%e8%b1%a1%e7%9a%84numpy-dtype%e6%a3%80%e6%9f%a5%e8%be%93%e5%85%a5%e6%95%b0%e6%8d%ae%e4%b8%8enp-asarraydata\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u5bb6\",\"item\":\"https:\/\/statorials.org\/cn\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u5982\u4f55\u4fee\u590d\uff1apandas \u6570\u636e\u8f6c\u6362\u4e3a numpy \u5bf9\u8c61\u7c7b\u578b\u3002\u4f7f\u7528 np.asarray(data) \u68c0\u67e5\u8f93\u5165\u6570\u636e\u3002\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/statorials.org\/cn\/#website\",\"url\":\"https:\/\/statorials.org\/cn\/\",\"name\":\"Statorials\",\"description\":\"\u60a8\u7684\u7edf\u8ba1\u7d20\u517b\u6307\u5357\uff01\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/statorials.org\/cn\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/statorials.org\/cn\/#\/schema\/person\/124e4e5b7c9f8dc0f1f95cc8c1db3261\",\"name\":\"\u672c\u6770\u660e\u00b7\u5b89\u5fb7\u68ee\u535a\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/statorials.org\/cn\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/statorials.org\/cn\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg\",\"contentUrl\":\"https:\/\/statorials.org\/cn\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg\",\"caption\":\"\u672c\u6770\u660e\u00b7\u5b89\u5fb7\u68ee\u535a\"},\"description\":\"\u5927\u5bb6\u597d\uff0c\u6211\u662f\u672c\u6770\u660e\uff0c\u4e00\u4f4d\u9000\u4f11\u7684\u7edf\u8ba1\u5b66\u6559\u6388\uff0c\u540e\u6765\u6210\u4e3a Statorials \u7684\u70ed\u5fc3\u6559\u5e08\u3002 \u51ed\u501f\u5728\u7edf\u8ba1\u9886\u57df\u7684\u4e30\u5bcc\u7ecf\u9a8c\u548c\u4e13\u4e1a\u77e5\u8bc6\uff0c\u6211\u6e34\u671b\u5206\u4eab\u6211\u7684\u77e5\u8bc6\uff0c\u901a\u8fc7 Statorials \u589e\u5f3a\u5b66\u751f\u7684\u80fd\u529b\u3002\u4e86\u89e3\u66f4\u591a\",\"sameAs\":[\"https:\/\/statorials.org\/cn\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u5982\u4f55\u4fee\u590d\uff1apandas \u6570\u636e\u8f6c\u6362\u4e3a numpy \u5bf9\u8c61\u7c7b\u578b\u3002\u4f7f\u7528 np.asarray(data) \u68c0\u67e5\u8f93\u5165\u6570\u636e\u3002 - Statorials","description":"\u672c\u6559\u7a0b\u4ecb\u7ecd\u5982\u4f55\u4fee\u590d\u4ee5\u4e0b\u9519\u8bef\uff1apandas \u6570\u636e\u8f6c\u6362\u4e3a numpy \u5bf9\u8c61\u7c7b\u578b\u3002\u4f7f\u7528 np.asarray(data) \u68c0\u67e5\u8f93\u5165\u6570\u636e\u3002","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/statorials.org\/cn\/pandas\u6570\u636e\u8f6c\u6362\u4e3a\u5bf9\u8c61\u7684numpy-dtype\u68c0\u67e5\u8f93\u5165\u6570\u636e\u4e0enp-asarraydata\/","og_locale":"zh_CN","og_type":"article","og_title":"\u5982\u4f55\u4fee\u590d\uff1apandas \u6570\u636e\u8f6c\u6362\u4e3a numpy \u5bf9\u8c61\u7c7b\u578b\u3002\u4f7f\u7528 np.asarray(data) \u68c0\u67e5\u8f93\u5165\u6570\u636e\u3002 - Statorials","og_description":"\u672c\u6559\u7a0b\u4ecb\u7ecd\u5982\u4f55\u4fee\u590d\u4ee5\u4e0b\u9519\u8bef\uff1apandas \u6570\u636e\u8f6c\u6362\u4e3a numpy \u5bf9\u8c61\u7c7b\u578b\u3002\u4f7f\u7528 np.asarray(data) \u68c0\u67e5\u8f93\u5165\u6570\u636e\u3002","og_url":"https:\/\/statorials.org\/cn\/pandas\u6570\u636e\u8f6c\u6362\u4e3a\u5bf9\u8c61\u7684numpy-dtype\u68c0\u67e5\u8f93\u5165\u6570\u636e\u4e0enp-asarraydata\/","og_site_name":"Statorials","article_published_time":"2023-07-22T08:36:27+00:00","author":"\u672c\u6770\u660e\u00b7\u5b89\u5fb7\u68ee\u535a","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"\u672c\u6770\u660e\u00b7\u5b89\u5fb7\u68ee\u535a","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"2 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/statorials.org\/cn\/pandas%e6%95%b0%e6%8d%ae%e8%bd%ac%e6%8d%a2%e4%b8%ba%e5%af%b9%e8%b1%a1%e7%9a%84numpy-dtype%e6%a3%80%e6%9f%a5%e8%be%93%e5%85%a5%e6%95%b0%e6%8d%ae%e4%b8%8enp-asarraydata\/","url":"https:\/\/statorials.org\/cn\/pandas%e6%95%b0%e6%8d%ae%e8%bd%ac%e6%8d%a2%e4%b8%ba%e5%af%b9%e8%b1%a1%e7%9a%84numpy-dtype%e6%a3%80%e6%9f%a5%e8%be%93%e5%85%a5%e6%95%b0%e6%8d%ae%e4%b8%8enp-asarraydata\/","name":"\u5982\u4f55\u4fee\u590d\uff1apandas \u6570\u636e\u8f6c\u6362\u4e3a numpy \u5bf9\u8c61\u7c7b\u578b\u3002\u4f7f\u7528 np.asarray(data) \u68c0\u67e5\u8f93\u5165\u6570\u636e\u3002 - Statorials","isPartOf":{"@id":"https:\/\/statorials.org\/cn\/#website"},"datePublished":"2023-07-22T08:36:27+00:00","dateModified":"2023-07-22T08:36:27+00:00","author":{"@id":"https:\/\/statorials.org\/cn\/#\/schema\/person\/124e4e5b7c9f8dc0f1f95cc8c1db3261"},"description":"\u672c\u6559\u7a0b\u4ecb\u7ecd\u5982\u4f55\u4fee\u590d\u4ee5\u4e0b\u9519\u8bef\uff1apandas \u6570\u636e\u8f6c\u6362\u4e3a numpy \u5bf9\u8c61\u7c7b\u578b\u3002\u4f7f\u7528 np.asarray(data) \u68c0\u67e5\u8f93\u5165\u6570\u636e\u3002","breadcrumb":{"@id":"https:\/\/statorials.org\/cn\/pandas%e6%95%b0%e6%8d%ae%e8%bd%ac%e6%8d%a2%e4%b8%ba%e5%af%b9%e8%b1%a1%e7%9a%84numpy-dtype%e6%a3%80%e6%9f%a5%e8%be%93%e5%85%a5%e6%95%b0%e6%8d%ae%e4%b8%8enp-asarraydata\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/statorials.org\/cn\/pandas%e6%95%b0%e6%8d%ae%e8%bd%ac%e6%8d%a2%e4%b8%ba%e5%af%b9%e8%b1%a1%e7%9a%84numpy-dtype%e6%a3%80%e6%9f%a5%e8%be%93%e5%85%a5%e6%95%b0%e6%8d%ae%e4%b8%8enp-asarraydata\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/statorials.org\/cn\/pandas%e6%95%b0%e6%8d%ae%e8%bd%ac%e6%8d%a2%e4%b8%ba%e5%af%b9%e8%b1%a1%e7%9a%84numpy-dtype%e6%a3%80%e6%9f%a5%e8%be%93%e5%85%a5%e6%95%b0%e6%8d%ae%e4%b8%8enp-asarraydata\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u5bb6","item":"https:\/\/statorials.org\/cn\/"},{"@type":"ListItem","position":2,"name":"\u5982\u4f55\u4fee\u590d\uff1apandas \u6570\u636e\u8f6c\u6362\u4e3a numpy \u5bf9\u8c61\u7c7b\u578b\u3002\u4f7f\u7528 np.asarray(data) \u68c0\u67e5\u8f93\u5165\u6570\u636e\u3002"}]},{"@type":"WebSite","@id":"https:\/\/statorials.org\/cn\/#website","url":"https:\/\/statorials.org\/cn\/","name":"Statorials","description":"\u60a8\u7684\u7edf\u8ba1\u7d20\u517b\u6307\u5357\uff01","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/statorials.org\/cn\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/statorials.org\/cn\/#\/schema\/person\/124e4e5b7c9f8dc0f1f95cc8c1db3261","name":"\u672c\u6770\u660e\u00b7\u5b89\u5fb7\u68ee\u535a","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/statorials.org\/cn\/#\/schema\/person\/image\/","url":"https:\/\/statorials.org\/cn\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg","contentUrl":"https:\/\/statorials.org\/cn\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg","caption":"\u672c\u6770\u660e\u00b7\u5b89\u5fb7\u68ee\u535a"},"description":"\u5927\u5bb6\u597d\uff0c\u6211\u662f\u672c\u6770\u660e\uff0c\u4e00\u4f4d\u9000\u4f11\u7684\u7edf\u8ba1\u5b66\u6559\u6388\uff0c\u540e\u6765\u6210\u4e3a Statorials \u7684\u70ed\u5fc3\u6559\u5e08\u3002 \u51ed\u501f\u5728\u7edf\u8ba1\u9886\u57df\u7684\u4e30\u5bcc\u7ecf\u9a8c\u548c\u4e13\u4e1a\u77e5\u8bc6\uff0c\u6211\u6e34\u671b\u5206\u4eab\u6211\u7684\u77e5\u8bc6\uff0c\u901a\u8fc7 Statorials \u589e\u5f3a\u5b66\u751f\u7684\u80fd\u529b\u3002\u4e86\u89e3\u66f4\u591a","sameAs":["https:\/\/statorials.org\/cn"]}]}},"yoast_meta":{"yoast_wpseo_title":"","yoast_wpseo_metadesc":"","yoast_wpseo_canonical":""},"_links":{"self":[{"href":"https:\/\/statorials.org\/cn\/wp-json\/wp\/v2\/posts\/2421","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/statorials.org\/cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/statorials.org\/cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/statorials.org\/cn\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/statorials.org\/cn\/wp-json\/wp\/v2\/comments?post=2421"}],"version-history":[{"count":0,"href":"https:\/\/statorials.org\/cn\/wp-json\/wp\/v2\/posts\/2421\/revisions"}],"wp:attachment":[{"href":"https:\/\/statorials.org\/cn\/wp-json\/wp\/v2\/media?parent=2421"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/statorials.org\/cn\/wp-json\/wp\/v2\/categories?post=2421"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/statorials.org\/cn\/wp-json\/wp\/v2\/tags?post=2421"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}