{"id":1209,"date":"2023-07-27T06:54:42","date_gmt":"2023-07-27T06:54:42","guid":{"rendered":"https:\/\/statorials.org\/ja\/python%e3%81%ae%e6%9c%80%e5%b0%8f%e9%83%a8%e5%88%86%e3%82%a8%e3%83%83%e3%82%b7%e3%82%99\/"},"modified":"2023-07-27T06:54:42","modified_gmt":"2023-07-27T06:54:42","slug":"python%e3%81%ae%e6%9c%80%e5%b0%8f%e9%83%a8%e5%88%86%e3%82%a8%e3%83%83%e3%82%b7%e3%82%99","status":"publish","type":"post","link":"https:\/\/statorials.org\/ja\/python%e3%81%ae%e6%9c%80%e5%b0%8f%e9%83%a8%e5%88%86%e3%82%a8%e3%83%83%e3%82%b7%e3%82%99\/","title":{"rendered":"Python \u306e\u90e8\u5206\u6700\u5c0f\u4e8c\u4e57\u6cd5 (\u30b9\u30c6\u30c3\u30d7\u30d0\u30a4\u30b9\u30c6\u30c3\u30d7)"},"content":{"rendered":"<p><\/p>\n<hr>\n<p><span style=\"color: #000000;\">\u6a5f\u68b0\u5b66\u7fd2\u3067\u906d\u9047\u3059\u308b\u6700\u3082\u4e00\u822c\u7684\u306a\u554f\u984c\u306e 1 \u3064\u306f\u3001 <a href=\"https:\/\/statorials.org\/ja\/\u591a\u91cd\u5171\u7dda\u6027\u56de\u5e30\/\" target=\"_blank\" rel=\"noopener noreferrer\">\u591a\u91cd\u5171\u7dda\u6027<\/a>\u3067\u3059\u3002\u3053\u308c\u306f\u3001\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u5185\u306e 2 \u3064\u4ee5\u4e0a\u306e\u4e88\u6e2c\u5b50\u5909\u6570\u306e\u76f8\u95a2\u6027\u304c\u9ad8\u3044\u5834\u5408\u306b\u767a\u751f\u3057\u307e\u3059\u3002<\/span><\/p>\n<p><span style=\"color: #000000;\">\u3053\u308c\u304c\u8d77\u3053\u308b\u3068\u3001\u30e2\u30c7\u30eb\u306f\u30c8\u30ec\u30fc\u30cb\u30f3\u30b0 \u30c7\u30fc\u30bf \u30bb\u30c3\u30c8\u306b\u3046\u307e\u304f\u9069\u5408\u3067\u304d\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u304c\u3001\u30c8\u30ec\u30fc\u30cb\u30f3\u30b0 \u30c7\u30fc\u30bf \u30bb\u30c3\u30c8\u306b\u904e\u5270\u9069\u5408\u3059\u308b\u305f\u3081\u3001\u3053\u308c\u307e\u3067\u306b\u898b\u305f\u3053\u3068\u306e\u306a\u3044\u65b0\u3057\u3044\u30c7\u30fc\u30bf \u30bb\u30c3\u30c8\u3067\u306f\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9<a href=\"https:\/\/statorials.org\/ja\/\u6a5f\u68b0\u5b66\u7fd2\u306e\u904e\u5b66\u7fd2\/\" target=\"_blank\" rel=\"noopener noreferrer\">\u304c\u4f4e\u4e0b\u3059\u308b<\/a>\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002\u30c8\u30ec\u30fc\u30cb\u30f3\u30b0\u30bb\u30c3\u30c8\u3002<\/span><\/p>\n<p><span style=\"color: #000000;\">\u3053\u306e\u554f\u984c\u3092\u56de\u907f\u3059\u308b 1 \u3064\u306e\u65b9\u6cd5\u306f\u3001\u6b21\u306e\u3088\u3046\u306b\u6a5f\u80fd\u3059\u308b <a href=\"https:\/\/statorials.org\/ja\/\u90e8\u5206\u6700\u5c0f\u4e8c\u4e57\/\" target=\"_blank\" rel=\"noopener noreferrer\">\u90e8\u5206\u6700\u5c0f\u4e8c\u4e57\u6cd5<\/a>\u3068\u547c\u3070\u308c\u308b\u65b9\u6cd5\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3067\u3059\u3002<\/span><\/p>\n<ul>\n<li><span style=\"color: #000000;\">\u4e88\u6e2c\u5909\u6570\u3068\u5fdc\u7b54\u5909\u6570\u3092\u6a19\u6e96\u5316\u3057\u307e\u3059\u3002<\/span><\/li>\n<li><span style=\"color: #000000;\">\u5fdc\u7b54\u5909\u6570\u3068\u4e88\u6e2c\u5b50\u5909\u6570\u306e\u4e21\u65b9\u306b\u304a\u3051\u308b\u6709\u610f\u306a\u91cf\u306e\u5909\u52d5\u3092\u8aac\u660e\u3059\u308b\u3001<\/span> <em style=\"color: #000000;\">p<\/em>\u500b\u306e\u5143\u306e\u4e88\u6e2c\u5b50\u5909\u6570<span style=\"color: #000000;\">\u306e<em>M \u500b<\/em>\u306e\u7dda\u5f62\u7d50\u5408 (\u300cPLS \u6210\u5206\u300d\u3068\u547c\u3070\u308c\u308b) \u3092\u8a08\u7b97\u3057\u307e\u3059<\/span>\u3002<\/li>\n<li><span style=\"color: #000000;\">\u6700\u5c0f\u4e8c\u4e57\u6cd5\u3092\u4f7f\u7528\u3057\u3066\u3001PLS \u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3092\u4e88\u6e2c\u5b50\u3068\u3057\u3066\u4f7f\u7528\u3057\u3066\u7dda\u5f62\u56de\u5e30\u30e2\u30c7\u30eb\u3092\u8fd1\u4f3c\u3057\u307e\u3059\u3002<\/span><\/li>\n<li> <span style=\"color: #000000;\"><a href=\"https:\/\/statorials.org\/ja\/k-\u5206\u5272\u4ea4\u5dee\u691c\u8a3c\/\" target=\"_blank\" rel=\"noopener noreferrer\">k \u5206\u5272\u4ea4\u5dee\u691c\u8a3c<\/a>\u3092\u4f7f\u7528\u3057\u3066\u3001\u30e2\u30c7\u30eb\u306b\u4fdd\u6301\u3059\u308b PLS \u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u306e\u6700\u9069\u306a\u6570\u3092\u898b\u3064\u3051\u307e\u3059\u3002<\/span><\/li>\n<\/ul>\n<p><span style=\"color: #000000;\">\u3053\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3067\u306f\u3001Python \u3067\u90e8\u5206\u6700\u5c0f\u4e8c\u4e57\u6cd5\u3092\u5b9f\u884c\u3059\u308b\u65b9\u6cd5\u3092\u6bb5\u968e\u7684\u306b\u8aac\u660e\u3057\u307e\u3059\u3002<\/span><\/p>\n<h3><span style=\"color: #000000;\"><strong>\u30b9\u30c6\u30c3\u30d7 1: \u5fc5\u8981\u306a\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30dd\u30fc\u30c8\u3059\u308b<\/strong><\/span><\/h3>\n<p><span style=\"color: #000000;\">\u307e\u305a\u3001Python \u3067\u90e8\u5206\u6700\u5c0f\u4e8c\u4e57\u6cd5\u3092\u5b9f\u884c\u3059\u308b\u305f\u3081\u306b\u5fc5\u8981\u306a\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30dd\u30fc\u30c8\u3057\u307e\u3059\u3002<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <span style=\"color: #000000;\"><strong><span style=\"color: #008000;\">import<\/span> numpy <span style=\"color: #008000;\">as<\/span> np\n<span style=\"color: #008000;\">import<\/span> pandas <span style=\"color: #008000;\">as<\/span> pd\n<span style=\"color: #008000;\">import<\/span> matplotlib. <span style=\"color: #3366ff;\">pyplot<\/span> <span style=\"color: #008000;\">as<\/span> plt\n<span style=\"color: #008000;\">from<\/span> sklearn. <span style=\"color: #3366ff;\">preprocessing<\/span> <span style=\"color: #008000;\">import<\/span> scale \n<span style=\"color: #008000;\">from<\/span> sklearn <span style=\"color: #008000;\">import<\/span> model_selection\n<span style=\"color: #008000;\">from<\/span> sklearn. <span style=\"color: #3366ff;\">model_selection<\/span> <span style=\"color: #008000;\">import<\/span> RepeatedKFold\n<span style=\"color: #008000;\">from<\/span> sklearn. <span style=\"color: #3366ff;\">model_selection<\/span> <span style=\"color: #008000;\">import<\/span> train_test_split\n<span style=\"color: #008000;\">from <span style=\"color: #000000;\">sklearn. <span style=\"color: #3366ff;\">cross_decomposition<\/span> <span style=\"color: #008000;\">import<\/span> PLSRegression<\/span>\n<span style=\"color: #008000;\">from<\/span> <span style=\"color: #000000;\">sklearn<\/span> . <span style=\"color: #3366ff;\">metrics<\/span> <span style=\"color: #008000;\">import<\/span> <span style=\"color: #000000;\">mean_squared_error\n<\/span><\/span><\/strong><\/span><\/pre>\n<h3><span style=\"color: #000000;\"><strong>\u30b9\u30c6\u30c3\u30d7 2: \u30c7\u30fc\u30bf\u3092\u30ed\u30fc\u30c9\u3059\u308b<\/strong><\/span><\/h3>\n<p><span style=\"color: #000000;\">\u3053\u306e\u4f8b\u3067\u306f\u300133 \u53f0\u306e\u7570\u306a\u308b\u8eca\u306b\u95a2\u3059\u308b\u60c5\u5831\u304c\u542b\u307e\u308c\u308b<strong>mtcars<\/strong>\u3068\u3044\u3046\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002\u5fdc\u7b54\u5909\u6570\u3068\u3057\u3066<strong>hp \u3092<\/strong>\u4f7f\u7528\u3057\u3001\u4e88\u6e2c\u5909\u6570\u3068\u3057\u3066\u6b21\u306e\u5909\u6570\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/span><\/p>\n<ul>\n<li> <span style=\"color: #000000;\">mpg<\/span><\/li>\n<li><span style=\"color: #000000;\">\u753b\u9762<\/span><\/li>\n<li><span style=\"color: #000000;\">\u305f\u308f\u3054\u3068<\/span><\/li>\n<li><span style=\"color: #000000;\">\u91cd\u3055<\/span><\/li>\n<li><span style=\"color: #000000;\">qsec<\/span><\/li>\n<\/ul>\n<p><span style=\"color: #000000;\">\u6b21\u306e\u30b3\u30fc\u30c9\u306f\u3001\u3053\u306e\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u3092\u30ed\u30fc\u30c9\u3057\u3066\u8868\u793a\u3059\u308b\u65b9\u6cd5\u3092\u793a\u3057\u3066\u3044\u307e\u3059\u3002<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <span style=\"color: #000000;\"><strong><span style=\"color: #008080;\">#define URL where data is located\n<\/span>url = \"https:\/\/raw.githubusercontent.com\/Statorials\/Python-Guides\/main\/mtcars.csv\"\n\n<span style=\"color: #008080;\">#read in data\n<\/span>data_full = pd. <span style=\"color: #3366ff;\">read_csv<\/span> (url)\n\n<span style=\"color: #008080;\">#select subset of data\n<\/span>data = data_full[[\"mpg\", \"disp\", \"drat\", \"wt\", \"qsec\", \"hp\"]]\n\n<span style=\"color: #008080;\">#view first six rows of data\n<\/span>data[0:6]\n\n\n        mpg disp drat wt qsec hp\n0 21.0 160.0 3.90 2.620 16.46 110\n1 21.0 160.0 3.90 2.875 17.02 110\n2 22.8 108.0 3.85 2.320 18.61 93\n3 21.4 258.0 3.08 3.215 19.44 110\n4 18.7 360.0 3.15 3.440 17.02 175\n5 18.1 225.0 2.76 3.460 20.22 105<\/strong><\/span><\/pre>\n<h3><strong>\u30b9\u30c6\u30c3\u30d7 3: \u90e8\u5206\u6700\u5c0f\u4e8c\u4e57\u30e2\u30c7\u30eb\u3092\u5f53\u3066\u306f\u3081\u308b<\/strong><\/h3>\n<p><span style=\"color: #000000;\">\u6b21\u306e\u30b3\u30fc\u30c9\u306f\u3001PLS \u30e2\u30c7\u30eb\u3092\u3053\u306e\u30c7\u30fc\u30bf\u306b\u9069\u5408\u3055\u305b\u308b\u65b9\u6cd5\u3092\u793a\u3057\u3066\u3044\u307e\u3059\u3002<\/span><\/p>\n<p> <span style=\"color: #000000;\"><strong>cv =repeatedKFold() \u306f\u3001<\/strong><a href=\"https:\/\/statorials.org\/ja\/k-\u5206\u5272\u4ea4\u5dee\u691c\u8a3c\/\" target=\"_blank\" rel=\"noopener noreferrer\">k \u5206\u5272\u76f8\u4e92\u691c\u8a3c<\/a>\u3092\u4f7f\u7528\u3057\u3066\u30e2\u30c7\u30eb\u306e\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u3092\u8a55\u4fa1\u3059\u308b\u3088\u3046\u306b Python \u306b\u6307\u793a\u3059\u308b\u3053\u3068\u306b<\/span><span style=\"color: #000000;\">\u6ce8\u610f\u3057\u3066\u304f\u3060\u3055\u3044<\/span>\u3002<span style=\"color: #000000;\">\u3053\u306e\u4f8b\u3067\u306f\u3001k = 10 \u306e\u6298\u308a\u3092\u9078\u629e\u3057\u30013 \u56de\u7e70\u308a\u8fd4\u3057\u307e\u3059\u3002<\/span> <\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <span style=\"color: #000000;\"><strong><span style=\"color: #008080;\">#define predictor and response variables\n<\/span>X = data[[\"mpg\", \"disp\", \"drat\", \"wt\", \"qsec\"]]\ny = data[[\"hp\"]]\n\n<span style=\"color: #008080;\">#define cross-validation method\n<span style=\"color: #000000;\">cv = RepeatedKFold(n_splits= <span style=\"color: #008000;\">10<\/span> , n_repeats= <span style=\"color: #008000;\">3<\/span> , random_state= <span style=\"color: #008000;\">1<\/span> )\n\nmse = []\nn = <span style=\"color: #3366ff;\">len<\/span> (X)<\/span>\n\n# Calculate MSE with only the intercept\n<span style=\"color: #000000;\">score = -1*model_selection. <span style=\"color: #3366ff;\">cross_val_score<\/span> (PLSRegression(n_components=1),<\/span>\n<span style=\"color: #000000;\">n.p. <span style=\"color: #3366ff;\">ones<\/span> ((n,1)), y, cv=cv, scoring=' <span style=\"color: #008000;\">neg_mean_squared_error<\/span> '). <span style=\"color: #3366ff;\">mean<\/span> ()    \nmse. <span style=\"color: #3366ff;\">append<\/span> (score)<\/span>\n\n# Calculate MSE using cross-validation, adding one component at a time\n<span style=\"color: #000000;\"><span style=\"color: #008000;\">for<\/span> i <span style=\"color: #008000;\">in<\/span> np. <span style=\"color: #3366ff;\">arange<\/span> (1, 6):\n    pls = PLSRegression(n_components=i)\n    score = -1*model_selection. <span style=\"color: #3366ff;\">cross_val_score<\/span> (pls, scale(X), y, cv=cv,\n               scoring=' <span style=\"color: #008000;\">neg_mean_squared_error<\/span> '). <span style=\"color: #3366ff;\">mean<\/span> ()\n    mse. <span style=\"color: #3366ff;\">append<\/span> (score)<\/span>\n\n#plot test MSE vs. number of components\n<span style=\"color: #000000;\">plt. <span style=\"color: #3366ff;\">plot<\/span> (mse)\nplt. <span style=\"color: #3366ff;\">xlabel<\/span> (' <span style=\"color: #008000;\">Number of PLS Components<\/span> ')\nplt. <span style=\"color: #3366ff;\">ylabel<\/span> (' <span style=\"color: #008000;\">MSE<\/span> ')\nplt. <span style=\"color: #3366ff;\">title<\/span> (' <span style=\"color: #008000;\">hp<\/span> ')<\/span>\n<\/span><\/strong><\/span><\/pre>\n<h3><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-11985 \" src=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/svppython1.png\" alt=\"Python \u76f8\u4e92\u691c\u8a3c\u30d7\u30ed\u30c3\u30c8\u306e\u90e8\u5206\u6700\u5c0f\u4e8c\u4e57\u6cd5\" width=\"405\" height=\"284\" srcset=\"\" sizes=\"auto, \"><\/h3>\n<p><span style=\"color: #000000;\">\u30d7\u30ed\u30c3\u30c8\u3067\u306f\u3001X \u8ef8\u306b\u6cbf\u3063\u3066 PLS \u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u306e\u6570\u304c\u8868\u793a\u3055\u308c\u3001Y \u8ef8\u306b\u6cbf\u3063\u3066 MSE (\u5e73\u5747\u4e8c\u4e57\u8aa4\u5dee) \u30c6\u30b9\u30c8\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/span><\/p>\n<p><span style=\"color: #000000;\">\u30b0\u30e9\u30d5\u304b\u3089\u30012 \u3064\u306e PLS \u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3092\u8ffd\u52a0\u3059\u308b\u3068\u30c6\u30b9\u30c8\u306e MSE \u304c\u6e1b\u5c11\u3057\u307e\u3059\u304c\u30013 \u3064\u4ee5\u4e0a\u306e PLS \u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3092\u8ffd\u52a0\u3059\u308b\u3068\u5897\u52a0\u3057\u59cb\u3081\u308b\u3053\u3068\u304c\u308f\u304b\u308a\u307e\u3059\u3002<\/span><\/p>\n<p><span style=\"color: #000000;\">\u3057\u305f\u304c\u3063\u3066\u3001\u6700\u9069\u306a\u30e2\u30c7\u30eb\u306b\u306f\u6700\u521d\u306e 2 \u3064\u306e PLS \u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u306e\u307f\u304c\u542b\u307e\u308c\u307e\u3059\u3002<\/span><\/p>\n<h3><span style=\"color: #000000;\"><strong>\u30b9\u30c6\u30c3\u30d7 4: \u6700\u7d42\u30e2\u30c7\u30eb\u3092\u4f7f\u7528\u3057\u3066\u4e88\u6e2c\u3092\u884c\u3046<\/strong><\/span><\/h3>\n<p><span style=\"color: #000000;\">2 \u3064\u306e PLS \u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3092\u542b\u3080\u6700\u7d42\u7684\u306a PLS \u30e2\u30c7\u30eb\u3092\u4f7f\u7528\u3057\u3066\u3001\u65b0\u3057\u3044\u89b3\u6e2c\u5024\u306b\u3064\u3044\u3066\u306e\u4e88\u6e2c\u3092\u884c\u3046\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/span><\/p>\n<p><span style=\"color: #000000;\">\u6b21\u306e\u30b3\u30fc\u30c9\u306f\u3001\u5143\u306e\u30c7\u30fc\u30bf \u30bb\u30c3\u30c8\u3092\u30c8\u30ec\u30fc\u30cb\u30f3\u30b0 \u30bb\u30c3\u30c8\u3068\u30c6\u30b9\u30c8 \u30bb\u30c3\u30c8\u306b\u5206\u5272\u3057\u30012 \u3064\u306e PLS \u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3092\u542b\u3080 PLS \u30e2\u30c7\u30eb\u3092\u4f7f\u7528\u3057\u3066\u30c6\u30b9\u30c8 \u30bb\u30c3\u30c8\u3067\u4e88\u6e2c\u3092\u884c\u3046\u65b9\u6cd5\u3092\u793a\u3057\u3066\u3044\u307e\u3059\u3002<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <span style=\"color: #000000;\"><strong><span style=\"color: #008080;\">#split the dataset into training (70%) and testing (30%) sets\n<\/span><span style=\"color: #3366ff;\">X_train<\/span> <span style=\"color: #008000;\">,<\/span> <span style=\"color: #008000;\">_<\/span><span style=\"color: #008080;\">\n\n#calculate RMSE\n<span style=\"color: #000000;\">pls = PLSRegression(n_components=2)\npls. <span style=\"color: #3366ff;\">fit<\/span> (scale(X_train), y_train)<\/span>\n\n<span style=\"color: #000000;\">n.p. <span style=\"color: #3366ff;\">sqrt<\/span> (mean_squared_error(y_test, pls. <span style=\"color: #3366ff;\">predict<\/span> (scale(X_test))))\n<\/span>\n<span style=\"color: #000000;\">29.9094\n<\/span><\/span><\/strong><\/span><\/pre>\n<p><span style=\"color: #000000;\">\u30c6\u30b9\u30c8\u306e RMSE \u304c<strong>29.9094<\/strong>\u3067\u3042\u308b\u3053\u3068\u304c\u308f\u304b\u308a\u307e\u3059\u3002\u3053\u308c\u306f\u3001\u30c6\u30b9\u30c8 \u30bb\u30c3\u30c8\u306e\u89b3\u6e2c\u5024\u306e\u4e88\u6e2c<em>hp<\/em>\u5024\u3068\u89b3\u6e2c\u3055\u308c\u305f<em>hp<\/em>\u5024\u306e\u9593\u306e\u5e73\u5747\u504f\u5dee\u3067\u3059\u3002<\/span><\/p>\n<p><span style=\"color: #000000;\">\u3053\u306e\u4f8b\u3067\u4f7f\u7528\u3055\u308c\u3066\u3044\u308b\u5b8c\u5168\u306a Python \u30b3\u30fc\u30c9\u306f\u3001 <a href=\"https:\/\/github.com\/Statorials\/Python-Guides\/blob\/main\/partial_least_squares.py\" target=\"_blank\" rel=\"noopener noreferrer\">\u3053\u3053\u306b<\/a>\u3042\u308a\u307e\u3059\u3002<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6a5f\u68b0\u5b66\u7fd2\u3067\u906d\u9047\u3059\u308b\u6700\u3082\u4e00\u822c\u7684\u306a\u554f\u984c\u306e 1 \u3064\u306f\u3001 \u591a\u91cd\u5171\u7dda\u6027\u3067\u3059\u3002\u3053\u308c\u306f\u3001\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u5185\u306e 2 \u3064\u4ee5\u4e0a\u306e\u4e88\u6e2c\u5b50\u5909\u6570\u306e\u76f8\u95a2\u6027\u304c\u9ad8\u3044\u5834\u5408\u306b\u767a\u751f\u3057\u307e\u3059\u3002 \u3053\u308c\u304c\u8d77\u3053\u308b\u3068\u3001\u30e2\u30c7\u30eb\u306f\u30c8\u30ec\u30fc\u30cb\u30f3\u30b0 \u30c7\u30fc\u30bf \u30bb\u30c3\u30c8\u306b\u3046\u307e\u304f\u9069\u5408\u3067\u304d\u308b\u304b [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-1209","post","type-post","status-publish","format-standard","hentry","category-16"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Python \u306e\u90e8\u5206\u6700\u5c0f\u4e8c\u4e57\u6cd5 (\u30b9\u30c6\u30c3\u30d7\u30d0\u30a4\u30b9\u30c6\u30c3\u30d7) - Statorials<\/title>\n<meta name=\"description\" content=\"\u3053\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3067\u306f\u3001Python \u3067\u90e8\u5206\u6700\u5c0f\u4e8c\u4e57\u6cd5\u3092\u5b9f\u884c\u3059\u308b\u65b9\u6cd5\u3092\u3001\u30b9\u30c6\u30c3\u30d7\u30d0\u30a4\u30b9\u30c6\u30c3\u30d7\u306e\u4f8b\u3092\u542b\u3081\u3066\u8aac\u660e\u3057\u307e\u3059\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\/ja\/python\u306e\u6700\u5c0f\u90e8\u5206\u30a8\u30c3\u30b7\u3099\/\" \/>\n<meta property=\"og:locale\" content=\"ja_JP\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Python \u306e\u90e8\u5206\u6700\u5c0f\u4e8c\u4e57\u6cd5 (\u30b9\u30c6\u30c3\u30d7\u30d0\u30a4\u30b9\u30c6\u30c3\u30d7) - Statorials\" \/>\n<meta property=\"og:description\" content=\"\u3053\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3067\u306f\u3001Python \u3067\u90e8\u5206\u6700\u5c0f\u4e8c\u4e57\u6cd5\u3092\u5b9f\u884c\u3059\u308b\u65b9\u6cd5\u3092\u3001\u30b9\u30c6\u30c3\u30d7\u30d0\u30a4\u30b9\u30c6\u30c3\u30d7\u306e\u4f8b\u3092\u542b\u3081\u3066\u8aac\u660e\u3057\u307e\u3059\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/statorials.org\/ja\/python\u306e\u6700\u5c0f\u90e8\u5206\u30a8\u30c3\u30b7\u3099\/\" \/>\n<meta property=\"og:site_name\" content=\"Statorials\" \/>\n<meta property=\"article:published_time\" content=\"2023-07-27T06:54:42+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/svppython1.png\" \/>\n<meta name=\"author\" content=\"\u30d9\u30f3\u30b8\u30e3\u30df\u30f3\u30fb\u30a2\u30f3\u30c0\u30fc\u30bd\u30f3\u535a\u58eb\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u57f7\u7b46\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u30d9\u30f3\u30b8\u30e3\u30df\u30f3\u30fb\u30a2\u30f3\u30c0\u30fc\u30bd\u30f3\u535a\u58eb\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593\" \/>\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\/ja\/python%e3%81%ae%e6%9c%80%e5%b0%8f%e9%83%a8%e5%88%86%e3%82%a8%e3%83%83%e3%82%b7%e3%82%99\/\",\"url\":\"https:\/\/statorials.org\/ja\/python%e3%81%ae%e6%9c%80%e5%b0%8f%e9%83%a8%e5%88%86%e3%82%a8%e3%83%83%e3%82%b7%e3%82%99\/\",\"name\":\"Python \u306e\u90e8\u5206\u6700\u5c0f\u4e8c\u4e57\u6cd5 (\u30b9\u30c6\u30c3\u30d7\u30d0\u30a4\u30b9\u30c6\u30c3\u30d7) - Statorials\",\"isPartOf\":{\"@id\":\"https:\/\/statorials.org\/ja\/#website\"},\"datePublished\":\"2023-07-27T06:54:42+00:00\",\"dateModified\":\"2023-07-27T06:54:42+00:00\",\"author\":{\"@id\":\"https:\/\/statorials.org\/ja\/#\/schema\/person\/86b92d2dd87368b26360d19d9c6a5d83\"},\"description\":\"\u3053\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3067\u306f\u3001Python \u3067\u90e8\u5206\u6700\u5c0f\u4e8c\u4e57\u6cd5\u3092\u5b9f\u884c\u3059\u308b\u65b9\u6cd5\u3092\u3001\u30b9\u30c6\u30c3\u30d7\u30d0\u30a4\u30b9\u30c6\u30c3\u30d7\u306e\u4f8b\u3092\u542b\u3081\u3066\u8aac\u660e\u3057\u307e\u3059\u3002\",\"breadcrumb\":{\"@id\":\"https:\/\/statorials.org\/ja\/python%e3%81%ae%e6%9c%80%e5%b0%8f%e9%83%a8%e5%88%86%e3%82%a8%e3%83%83%e3%82%b7%e3%82%99\/#breadcrumb\"},\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/statorials.org\/ja\/python%e3%81%ae%e6%9c%80%e5%b0%8f%e9%83%a8%e5%88%86%e3%82%a8%e3%83%83%e3%82%b7%e3%82%99\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/statorials.org\/ja\/python%e3%81%ae%e6%9c%80%e5%b0%8f%e9%83%a8%e5%88%86%e3%82%a8%e3%83%83%e3%82%b7%e3%82%99\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u5bb6\",\"item\":\"https:\/\/statorials.org\/ja\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Python \u306e\u90e8\u5206\u6700\u5c0f\u4e8c\u4e57\u6cd5 (\u30b9\u30c6\u30c3\u30d7\u30d0\u30a4\u30b9\u30c6\u30c3\u30d7)\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/statorials.org\/ja\/#website\",\"url\":\"https:\/\/statorials.org\/ja\/\",\"name\":\"Statorials\",\"description\":\"\u7d71\u8a08\u80fd\u529b\u3078\u306e\u30ac\u30a4\u30c9\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/statorials.org\/ja\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"ja\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/statorials.org\/ja\/#\/schema\/person\/86b92d2dd87368b26360d19d9c6a5d83\",\"name\":\"\u30d9\u30f3\u30b8\u30e3\u30df\u30f3\u30fb\u30a2\u30f3\u30c0\u30fc\u30bd\u30f3\u535a\u58eb\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\/\/statorials.org\/ja\/#\/schema\/person\/image\/\",\"url\":\"http:\/\/statorials.org\/ja\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg\",\"contentUrl\":\"http:\/\/statorials.org\/ja\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg\",\"caption\":\"\u30d9\u30f3\u30b8\u30e3\u30df\u30f3\u30fb\u30a2\u30f3\u30c0\u30fc\u30bd\u30f3\u535a\u58eb\"},\"description\":\"\u79c1\u306f\u30d9\u30f3\u30b8\u30e3\u30df\u30f3\u3067\u3059\u3002\u9000\u8077\u3057\u305f\u7d71\u8a08\u6559\u6388\u304b\u3089\u3001\u5c02\u4efb\u306e Statorials \u6559\u80b2\u8005\u306b\u306a\u308a\u307e\u3057\u305f\u3002 \u7d71\u8a08\u5206\u91ce\u306b\u304a\u3051\u308b\u8c4a\u5bcc\u306a\u7d4c\u9a13\u3068\u5c02\u9580\u77e5\u8b58\u3092\u6d3b\u304b\u3057\u3066\u3001\u79c1\u306f Statorials \u3092\u901a\u3058\u3066\u5b66\u751f\u306b\u529b\u3092\u4e0e\u3048\u308b\u305f\u3081\u306b\u81ea\u5206\u306e\u77e5\u8b58\u3092\u5171\u6709\u3059\u308b\u3053\u3068\u306b\u5c3d\u529b\u3057\u3066\u3044\u307e\u3059\u3002\u3082\u3063\u3068\u77e5\u308b\",\"sameAs\":[\"http:\/\/statorials.org\/ja\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Python \u306e\u90e8\u5206\u6700\u5c0f\u4e8c\u4e57\u6cd5 (\u30b9\u30c6\u30c3\u30d7\u30d0\u30a4\u30b9\u30c6\u30c3\u30d7) - Statorials","description":"\u3053\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3067\u306f\u3001Python \u3067\u90e8\u5206\u6700\u5c0f\u4e8c\u4e57\u6cd5\u3092\u5b9f\u884c\u3059\u308b\u65b9\u6cd5\u3092\u3001\u30b9\u30c6\u30c3\u30d7\u30d0\u30a4\u30b9\u30c6\u30c3\u30d7\u306e\u4f8b\u3092\u542b\u3081\u3066\u8aac\u660e\u3057\u307e\u3059\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\/ja\/python\u306e\u6700\u5c0f\u90e8\u5206\u30a8\u30c3\u30b7\u3099\/","og_locale":"ja_JP","og_type":"article","og_title":"Python \u306e\u90e8\u5206\u6700\u5c0f\u4e8c\u4e57\u6cd5 (\u30b9\u30c6\u30c3\u30d7\u30d0\u30a4\u30b9\u30c6\u30c3\u30d7) - Statorials","og_description":"\u3053\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3067\u306f\u3001Python \u3067\u90e8\u5206\u6700\u5c0f\u4e8c\u4e57\u6cd5\u3092\u5b9f\u884c\u3059\u308b\u65b9\u6cd5\u3092\u3001\u30b9\u30c6\u30c3\u30d7\u30d0\u30a4\u30b9\u30c6\u30c3\u30d7\u306e\u4f8b\u3092\u542b\u3081\u3066\u8aac\u660e\u3057\u307e\u3059\u3002","og_url":"https:\/\/statorials.org\/ja\/python\u306e\u6700\u5c0f\u90e8\u5206\u30a8\u30c3\u30b7\u3099\/","og_site_name":"Statorials","article_published_time":"2023-07-27T06:54:42+00:00","og_image":[{"url":"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/svppython1.png"}],"author":"\u30d9\u30f3\u30b8\u30e3\u30df\u30f3\u30fb\u30a2\u30f3\u30c0\u30fc\u30bd\u30f3\u535a\u58eb","twitter_card":"summary_large_image","twitter_misc":{"\u57f7\u7b46\u8005":"\u30d9\u30f3\u30b8\u30e3\u30df\u30f3\u30fb\u30a2\u30f3\u30c0\u30fc\u30bd\u30f3\u535a\u58eb","\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593":"2\u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/statorials.org\/ja\/python%e3%81%ae%e6%9c%80%e5%b0%8f%e9%83%a8%e5%88%86%e3%82%a8%e3%83%83%e3%82%b7%e3%82%99\/","url":"https:\/\/statorials.org\/ja\/python%e3%81%ae%e6%9c%80%e5%b0%8f%e9%83%a8%e5%88%86%e3%82%a8%e3%83%83%e3%82%b7%e3%82%99\/","name":"Python \u306e\u90e8\u5206\u6700\u5c0f\u4e8c\u4e57\u6cd5 (\u30b9\u30c6\u30c3\u30d7\u30d0\u30a4\u30b9\u30c6\u30c3\u30d7) - Statorials","isPartOf":{"@id":"https:\/\/statorials.org\/ja\/#website"},"datePublished":"2023-07-27T06:54:42+00:00","dateModified":"2023-07-27T06:54:42+00:00","author":{"@id":"https:\/\/statorials.org\/ja\/#\/schema\/person\/86b92d2dd87368b26360d19d9c6a5d83"},"description":"\u3053\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3067\u306f\u3001Python \u3067\u90e8\u5206\u6700\u5c0f\u4e8c\u4e57\u6cd5\u3092\u5b9f\u884c\u3059\u308b\u65b9\u6cd5\u3092\u3001\u30b9\u30c6\u30c3\u30d7\u30d0\u30a4\u30b9\u30c6\u30c3\u30d7\u306e\u4f8b\u3092\u542b\u3081\u3066\u8aac\u660e\u3057\u307e\u3059\u3002","breadcrumb":{"@id":"https:\/\/statorials.org\/ja\/python%e3%81%ae%e6%9c%80%e5%b0%8f%e9%83%a8%e5%88%86%e3%82%a8%e3%83%83%e3%82%b7%e3%82%99\/#breadcrumb"},"inLanguage":"ja","potentialAction":[{"@type":"ReadAction","target":["https:\/\/statorials.org\/ja\/python%e3%81%ae%e6%9c%80%e5%b0%8f%e9%83%a8%e5%88%86%e3%82%a8%e3%83%83%e3%82%b7%e3%82%99\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/statorials.org\/ja\/python%e3%81%ae%e6%9c%80%e5%b0%8f%e9%83%a8%e5%88%86%e3%82%a8%e3%83%83%e3%82%b7%e3%82%99\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u5bb6","item":"https:\/\/statorials.org\/ja\/"},{"@type":"ListItem","position":2,"name":"Python \u306e\u90e8\u5206\u6700\u5c0f\u4e8c\u4e57\u6cd5 (\u30b9\u30c6\u30c3\u30d7\u30d0\u30a4\u30b9\u30c6\u30c3\u30d7)"}]},{"@type":"WebSite","@id":"https:\/\/statorials.org\/ja\/#website","url":"https:\/\/statorials.org\/ja\/","name":"Statorials","description":"\u7d71\u8a08\u80fd\u529b\u3078\u306e\u30ac\u30a4\u30c9","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/statorials.org\/ja\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"ja"},{"@type":"Person","@id":"https:\/\/statorials.org\/ja\/#\/schema\/person\/86b92d2dd87368b26360d19d9c6a5d83","name":"\u30d9\u30f3\u30b8\u30e3\u30df\u30f3\u30fb\u30a2\u30f3\u30c0\u30fc\u30bd\u30f3\u535a\u58eb","image":{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/statorials.org\/ja\/#\/schema\/person\/image\/","url":"http:\/\/statorials.org\/ja\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg","contentUrl":"http:\/\/statorials.org\/ja\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg","caption":"\u30d9\u30f3\u30b8\u30e3\u30df\u30f3\u30fb\u30a2\u30f3\u30c0\u30fc\u30bd\u30f3\u535a\u58eb"},"description":"\u79c1\u306f\u30d9\u30f3\u30b8\u30e3\u30df\u30f3\u3067\u3059\u3002\u9000\u8077\u3057\u305f\u7d71\u8a08\u6559\u6388\u304b\u3089\u3001\u5c02\u4efb\u306e Statorials \u6559\u80b2\u8005\u306b\u306a\u308a\u307e\u3057\u305f\u3002 \u7d71\u8a08\u5206\u91ce\u306b\u304a\u3051\u308b\u8c4a\u5bcc\u306a\u7d4c\u9a13\u3068\u5c02\u9580\u77e5\u8b58\u3092\u6d3b\u304b\u3057\u3066\u3001\u79c1\u306f Statorials \u3092\u901a\u3058\u3066\u5b66\u751f\u306b\u529b\u3092\u4e0e\u3048\u308b\u305f\u3081\u306b\u81ea\u5206\u306e\u77e5\u8b58\u3092\u5171\u6709\u3059\u308b\u3053\u3068\u306b\u5c3d\u529b\u3057\u3066\u3044\u307e\u3059\u3002\u3082\u3063\u3068\u77e5\u308b","sameAs":["http:\/\/statorials.org\/ja"]}]}},"yoast_meta":{"yoast_wpseo_title":"","yoast_wpseo_metadesc":"","yoast_wpseo_canonical":""},"_links":{"self":[{"href":"https:\/\/statorials.org\/ja\/wp-json\/wp\/v2\/posts\/1209","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/statorials.org\/ja\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/statorials.org\/ja\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/statorials.org\/ja\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/statorials.org\/ja\/wp-json\/wp\/v2\/comments?post=1209"}],"version-history":[{"count":0,"href":"https:\/\/statorials.org\/ja\/wp-json\/wp\/v2\/posts\/1209\/revisions"}],"wp:attachment":[{"href":"https:\/\/statorials.org\/ja\/wp-json\/wp\/v2\/media?parent=1209"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/statorials.org\/ja\/wp-json\/wp\/v2\/categories?post=1209"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/statorials.org\/ja\/wp-json\/wp\/v2\/tags?post=1209"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}