{"id":19035,"date":"2023-08-07T02:00:04","date_gmt":"2023-08-07T02:00:04","guid":{"rendered":"https:\/\/club.informatix.co.jp\/?p=19035"},"modified":"2024-11-05T06:50:29","modified_gmt":"2024-11-05T06:50:29","slug":"python%e3%81%a73%e6%ac%a1%e6%96%b9%e7%a8%8b%e5%bc%8f%e3%82%92%e8%a7%a3%e3%81%8f%ef%bd%9cpython%e3%81%a7%e6%95%b0%e5%ad%a6%e3%82%92%e5%ad%a6%e3%81%bc%e3%81%86%ef%bc%81%e3%80%80%e7%ac%ac35%e5%9b%9e","status":"publish","type":"post","link":"https:\/\/club.informatix.co.jp\/?p=19035","title":{"rendered":"Python\u30673\u6b21\u65b9\u7a0b\u5f0f\u3092\u89e3\u304f\uff5cPython\u3067\u6570\u5b66\u3092\u5b66\u307c\u3046\uff01 \u7b2c35\u56de"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">\u76ee\u6b21<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-69f22a63951f6\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-69f22a63951f6\" checked aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/club.informatix.co.jp\/?p=19035\/#%E4%BB%A3%E6%95%B0%E8%A8%88%E7%AE%97%E3%83%A9%E3%82%A4%E3%83%96%E3%83%A9%E3%83%AASymPy%E3%81%AE%E3%82%A4%E3%83%B3%E3%83%9D%E3%83%BC%E3%83%88\" >\u4ee3\u6570\u8a08\u7b97\u30e9\u30a4\u30d6\u30e9\u30eaSymPy\u306e\u30a4\u30f3\u30dd\u30fc\u30c8<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/club.informatix.co.jp\/?p=19035\/#%E3%82%A4%E3%83%B3%E3%83%9D%E3%83%BC%E3%83%88%E3%81%AE%E6%96%B9%E6%B3%95%E3%81%9D%E3%81%AE1%EF%BD%9Cimport_%E3%83%A9%E3%82%A4%E3%83%96%E3%83%A9%E3%83%AA%E5%90%8D\" >\u30a4\u30f3\u30dd\u30fc\u30c8\u306e\u65b9\u6cd5\u305d\u306e1\uff5cimport \u30e9\u30a4\u30d6\u30e9\u30ea\u540d<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/club.informatix.co.jp\/?p=19035\/#%E3%82%A4%E3%83%B3%E3%83%9D%E3%83%BC%E3%83%88%E3%81%AE%E6%96%B9%E6%B3%95%E3%81%9D%E3%81%AE2%EF%BD%9Cimport_%E3%83%A9%E3%82%A4%E3%83%96%E3%83%A9%E3%83%AA%E5%90%8D_as_%E5%88%A5%E5%90%8D\" >\u30a4\u30f3\u30dd\u30fc\u30c8\u306e\u65b9\u6cd5\u305d\u306e2\uff5cimport \u30e9\u30a4\u30d6\u30e9\u30ea\u540d as \u5225\u540d<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/club.informatix.co.jp\/?p=19035\/#%E3%82%A4%E3%83%B3%E3%83%9D%E3%83%BC%E3%83%88%E3%81%AE%E6%96%B9%E6%B3%95%E3%81%9D%E3%81%AE3%EF%BD%9Cfrom_%E3%83%A9%E3%82%A4%E3%83%96%E3%83%A9%E3%83%AA%E5%90%8D_import_func1_func2\" >\u30a4\u30f3\u30dd\u30fc\u30c8\u306e\u65b9\u6cd5\u305d\u306e3\uff5cfrom \u30e9\u30a4\u30d6\u30e9\u30ea\u540d import func1, func2<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/club.informatix.co.jp\/?p=19035\/#%E3%82%A4%E3%83%B3%E3%83%9D%E3%83%BC%E3%83%88%E3%81%AE%E6%96%B9%E6%B3%95%E3%81%9D%E3%81%AE4%EF%BD%9Cfrom_%E3%83%A9%E3%82%A4%E3%83%96%E3%83%A9%E3%83%AA%E5%90%8D_import\" >\u30a4\u30f3\u30dd\u30fc\u30c8\u306e\u65b9\u6cd5\u305d\u306e4\uff5cfrom \u30e9\u30a4\u30d6\u30e9\u30ea\u540d import *<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/club.informatix.co.jp\/?p=19035\/#sympysolve%E3%81%A72%E6%AC%A1%E6%96%B9%E7%A8%8B%E5%BC%8F3x%C2%B2-4x50%E3%82%92%E8%A7%A3%E3%81%8F\" >sympy.solve()\u30672\u6b21\u65b9\u7a0b\u5f0f3x\u00b2-4x+5=0\u3092\u89e3\u304f<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/club.informatix.co.jp\/?p=19035\/#sympyinit_printing%E3%81%A7%E8%A7%A3%E3%81%AE%E8%A1%A8%E7%A4%BA%E3%82%92%E8%87%AA%E7%84%B6%E6%95%B0%E5%BC%8F%E8%A1%A8%E7%A4%BA%E3%81%AB%E3%81%99%E3%82%8B\" >sympy.init_printing()\u3067\u89e3\u306e\u8868\u793a\u3092\u81ea\u7136\u6570\u5f0f\u8868\u793a\u306b\u3059\u308b<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/club.informatix.co.jp\/?p=19035\/#2%E6%AC%A1%E6%96%B9%E7%A8%8B%E5%BC%8Fax%C2%B2bxc0%E3%82%92%E8%A7%A3%E3%81%8F\" >2\u6b21\u65b9\u7a0b\u5f0fax\u00b2+bx+c=0\u3092\u89e3\u304f<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/club.informatix.co.jp\/?p=19035\/#3%E6%AC%A1%E6%96%B9%E7%A8%8B%E5%BC%8Fax%C2%B3bx%C2%B2csd0%E3%82%92%E8%A7%A3%E3%81%8F\" >3\u6b21\u65b9\u7a0b\u5f0fax\u00b3+bx\u00b2+cs+d=0\u3092\u89e3\u304f<\/a><\/li><\/ul><\/nav><\/div>\n\n<h2><span class=\"ez-toc-section\" id=\"%E4%BB%A3%E6%95%B0%E8%A8%88%E7%AE%97%E3%83%A9%E3%82%A4%E3%83%96%E3%83%A9%E3%83%AASymPy%E3%81%AE%E3%82%A4%E3%83%B3%E3%83%9D%E3%83%BC%E3%83%88\"><\/span>\u4ee3\u6570\u8a08\u7b97\u30e9\u30a4\u30d6\u30e9\u30eaSymPy\u306e\u30a4\u30f3\u30dd\u30fc\u30c8<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>SymPy\u306e\u3059\u3054\u3055\u3092\u4e00\u8a00\u3067\u8a00\u3044\u8868\u3059\u306a\u3089\u3070\u300c\u6570\u5b66\u306e\u7389\u624b\u7bb1\u300d\u3067\u3059\u3002SymPy\u306b\u304e\u3063\u3057\u308a\u8a70\u307e\u3063\u305f\u6570\u5b66\u3092Python\u3092\u901a\u3057\u3066\u4fbf\u5229\u306b\u5f15\u304d\u51fa\u3059\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u4e2d\u5b66\u30fb\u9ad8\u6821\u306e\u6570\u5b66\u3067\u767b\u5834\u3057\u305f\u65b9\u7a0b\u5f0f\u3082SymPy\u306b\u304b\u304b\u308c\u3070\u7c21\u5358\u306b\u89e3\u3044\u3066\u304f\u308c\u307e\u3059\u3002\u65b9\u7a0b\u5f0f\u3068\u3044\u3063\u3066\u3082\u69d8\u3005\u306a\u7a2e\u985e\u304c\u3042\u308a\u307e\u3059\u3002\u4eca\u56de\u306fn\u6b21\u65b9\u7a0b\u5f0f\u3068<a href=\"https:\/\/club.informatix.co.jp\/?p=4770\" target=\"_blank\" rel=\"noopener\">\u5fae\u5206<\/a>\u65b9\u7a0b\u5f0f\u3092\u3068\u308a\u3042\u3052\u307e\u3059\u3002<\/p>\n<p>\u30e9\u30a4\u30d6\u30e9\u30ea\u30fb\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u30a4\u30f3\u30dd\u30fc\u30c8\u306e\u65b9\u6cd5\u306b\u3064\u3044\u3066\u3042\u3089\u305f\u3081\u3066\u307e\u3068\u3081\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n<h3><span class=\"ez-toc-section\" id=\"%E3%82%A4%E3%83%B3%E3%83%9D%E3%83%BC%E3%83%88%E3%81%AE%E6%96%B9%E6%B3%95%E3%81%9D%E3%81%AE1%EF%BD%9Cimport_%E3%83%A9%E3%82%A4%E3%83%96%E3%83%A9%E3%83%AA%E5%90%8D\"><\/span>\u30a4\u30f3\u30dd\u30fc\u30c8\u306e\u65b9\u6cd5\u305d\u306e1\uff5cimport \u30e9\u30a4\u30d6\u30e9\u30ea\u540d<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>SymPy\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u30a4\u30f3\u30dd\u30fc\u30c8\u3059\u308b\u306b\u306f<br \/>\n&gt;&gt;&gt;\u00a0 import sympy<br \/>\n\u3068\u3059\u308b\u306e\u304c\u57fa\u672c\u3067\u3059\u3002SymPy\u30e9\u30a4\u30d6\u30e9\u30ea\u306b\u542b\u307e\u308c\u308b\u95a2\u6570\u3092\u4f7f\u3046\u5834\u5408\u306b\u306f<br \/>\n&gt;&gt;&gt;\u00a0 sympy.func()<br \/>\n\u306e\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n<h3><span class=\"ez-toc-section\" id=\"%E3%82%A4%E3%83%B3%E3%83%9D%E3%83%BC%E3%83%88%E3%81%AE%E6%96%B9%E6%B3%95%E3%81%9D%E3%81%AE2%EF%BD%9Cimport_%E3%83%A9%E3%82%A4%E3%83%96%E3%83%A9%E3%83%AA%E5%90%8D_as_%E5%88%A5%E5%90%8D\"><\/span>\u30a4\u30f3\u30dd\u30fc\u30c8\u306e\u65b9\u6cd5\u305d\u306e2\uff5cimport \u30e9\u30a4\u30d6\u30e9\u30ea\u540d as \u5225\u540d<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\u9577\u3044\u540d\u524d\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u540d\u306e\u4ee3\u308f\u308a\u306b\u5225\u540d\u3092\u4f7f\u3046\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002sympy\u306e\u5834\u5408sym\u3084sp\u304c\u3088\u304f\u4f7f\u308f\u308c\u307e\u3059\u3002<br \/>\n&gt;&gt;&gt;\u00a0 import sympy as sym<br \/>\n&gt;&gt;&gt;\u00a0 sym.func()<br \/>\n&gt;&gt;&gt;\u00a0 import sympy as sp<br \/>\n&gt;&gt;&gt;\u00a0 sp.func()<br \/>\n\u306e\u3088\u3046\u306b\u4f7f\u3044\u307e\u3059\u3002\u305f\u3060\u3057\u77ed\u7e2e\u540d\u3092\u5ba3\u8a00\u3059\u308b\u3068\u3001\u3082\u3068\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u540d\u306f\u4f7f\u3048\u306a\u304f\u306a\u308a\u307e\u3059\u3002<\/p>\n<h3><span class=\"ez-toc-section\" id=\"%E3%82%A4%E3%83%B3%E3%83%9D%E3%83%BC%E3%83%88%E3%81%AE%E6%96%B9%E6%B3%95%E3%81%9D%E3%81%AE3%EF%BD%9Cfrom_%E3%83%A9%E3%82%A4%E3%83%96%E3%83%A9%E3%83%AA%E5%90%8D_import_func1_func2\"><\/span>\u30a4\u30f3\u30dd\u30fc\u30c8\u306e\u65b9\u6cd5\u305d\u306e3\uff5cfrom \u30e9\u30a4\u30d6\u30e9\u30ea\u540d import func1, func2<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\u30e9\u30a4\u30d6\u30e9\u30ea\u3067\u5b9a\u7fa9\u3055\u308c\u305f\u6307\u5b9a\u3057\u305f\u95a2\u6570\u3060\u3051\u3092\u4f7f\u3046\u5834\u5408\u306b\u3053\u306e\u65b9\u6cd5\u3092\u4f7f\u3044\u307e\u3059\u3002sympy.func1()\u3001sympy.func2()\u306fsympy.\u3092\u4ed8\u3051\u305a\u306bfunc1()\u3001func2()\u3068\u3057\u3066\u4f7f\u3046\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<h3><span class=\"ez-toc-section\" id=\"%E3%82%A4%E3%83%B3%E3%83%9D%E3%83%BC%E3%83%88%E3%81%AE%E6%96%B9%E6%B3%95%E3%81%9D%E3%81%AE4%EF%BD%9Cfrom_%E3%83%A9%E3%82%A4%E3%83%96%E3%83%A9%E3%83%AA%E5%90%8D_import\"><\/span>\u30a4\u30f3\u30dd\u30fc\u30c8\u306e\u65b9\u6cd5\u305d\u306e4\uff5cfrom \u30e9\u30a4\u30d6\u30e9\u30ea\u540d import *<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\u30e9\u30a4\u30d6\u30e9\u30ea\u306e\u3059\u3079\u3066\u306e\u95a2\u6570\u3092\u30e9\u30a4\u30d6\u30e9\u30ea\u540d\u3092\u7701\u7565\u3057\u3066\u4f7f\u3046\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<br \/>\n&gt;&gt;&gt;\u00a0 from sympy import *<br \/>\n&gt;&gt;&gt;\u00a0 func1()<br \/>\n&gt;&gt;&gt;\u00a0 func2()<br \/>\n&gt;&gt;&gt;\u00a0 func3()<br \/>\n*\u3092\u4f7f\u3063\u305f\u30a4\u30f3\u30dd\u30fc\u30c8\u306f\u591a\u304f\u306e\u95a2\u6570\u3092\u4f7f\u3046\u5834\u5408\u306b\u306f\u4fbf\u5229\u3067\u3059\u3002\u3057\u304b\u3057\u3001\u8907\u6570\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u30a4\u30f3\u30dd\u30fc\u30c8\u3057\u305f\u5834\u5408\u306b\u306f\u3001\u95a2\u6570\u304c\u3069\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u306e\u3082\u306e\u306a\u306e\u304b\u304c\u5206\u304b\u3089\u306a\u304f\u306a\u308b\u306e\u3067\u6ce8\u610f\u304c\u5fc5\u8981\u3067\u3059\u3002<\/p>\n<h2><span class=\"ez-toc-section\" id=\"sympysolve%E3%81%A72%E6%AC%A1%E6%96%B9%E7%A8%8B%E5%BC%8F3x%C2%B2-4x50%E3%82%92%E8%A7%A3%E3%81%8F\"><\/span>sympy.solve()\u30672\u6b21\u65b9\u7a0b\u5f0f3x\u00b2-4x+5=0\u3092\u89e3\u304f<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>2\u6b21\u65b9\u7a0b\u5f0f<br \/>\n3x\u00b2-4x+5=0<br \/>\n\u3092\u89e3\u3044\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>&gt;&gt;&gt;\u00a0 import sympy<br \/>\n&gt;&gt;&gt;\u00a0 x = sympy.Symbol(&#8216;x&#8217;)<br \/>\n&gt;&gt;&gt;\u00a0 sympy.solve(3*x**2-4*x+5)<br \/>\n[2\/3 &#8211; sqrt(11)*I\/3, 2\/3 + sqrt(11)*I\/3]<\/p>\n<p>3\u884c\u76ee\u306f\u898b\u305f\u901a\u308a\u3067\u3059\u30022\u6b21\u65b9\u7a0b\u5f0f\u306e\u53f3\u8fba\u30920\u306b\u3057\u305f\u3068\u304d\u306e\u5de6\u8fba\u3092sympy.solve()\u306e\u5f15\u6570\u306b\u6e21\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>2\u884c\u76ee\u304c\u30dd\u30a4\u30f3\u30c8\u3067\u3059\u3002x\u3092\u4ee3\u6570x\u3068\u3057\u3066\u4f7f\u3046\u305f\u3081\u306e\u8a2d\u5b9a\u3067\u3059\u3002Python\u3067\u306f\u5909\u6570x\u306b\u306f\u6587\u304b\u6570\u3092\u4ee3\u5165\u3067\u304d\u307e\u3059\u304c\u4ee3\u6570\u3068\u3057\u3066\u4f7f\u3046\u3053\u3068\u306f\u3067\u304d\u306a\u3044\u306e\u3067\u305d\u306e\u305f\u3081\u306e\u6e96\u5099\u304c\u5fc5\u8981\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>sympy.Symbol()\u3067\u5b9a\u7fa9\u3055\u308c\u305f\u5909\u6570x\u3092\u30b7\u30f3\u30dc\u30ea\u30c3\u30af\u5909\u6570\uff08Symbolic variable\uff09\u3068\u3044\u3044\u307e\u3059\u3002\u30e9\u30a4\u30d6\u30e9\u30ea\u540dSymPy\u306eSym\u3068\u306fSymbol\u304c\u7531\u6765\u3067\u3059\u3002<\/p>\n<h2><span class=\"ez-toc-section\" id=\"sympyinit_printing%E3%81%A7%E8%A7%A3%E3%81%AE%E8%A1%A8%E7%A4%BA%E3%82%92%E8%87%AA%E7%84%B6%E6%95%B0%E5%BC%8F%E8%A1%A8%E7%A4%BA%E3%81%AB%E3%81%99%E3%82%8B\"><\/span>sympy.init_printing()\u3067\u89e3\u306e\u8868\u793a\u3092\u81ea\u7136\u6570\u5f0f\u8868\u793a\u306b\u3059\u308b<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>\u51fa\u529b\u3055\u308c\u305f\u89e3\u306f\u308f\u304b\u308a\u3065\u3089\u3044\u3067\u3059\u3002sympy.init_printing()\u95a2\u6570\u3092\u5b9f\u884c\u3059\u308b\u3053\u3068\u3067\u51fa\u529b\u3092\u304d\u308c\u3044\u306a\u81ea\u7136\u6570\u5f0f\u8868\u793a\u306b\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>&gt;&gt;&gt;\u00a0 import sympy<br \/>\n&gt;&gt;&gt;\u00a0 sympy.init_printing()<br \/>\n&gt;&gt;&gt;\u00a0 x = sympy.Symbol(&#8216;x&#8217;)<br \/>\n&gt;&gt;&gt;\u00a0 sympy.solve(3*x**2-4*x+5)<\/p>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-19040\" src=\"https:\/\/club.informatix.co.jp\/wp-content\/uploads\/2023\/08\/20230801-1.jpg\" alt=\"\" width=\"400\" height=\"106\" srcset=\"https:\/\/club.informatix.co.jp\/wp-content\/uploads\/2023\/08\/20230801-1.jpg 429w, https:\/\/club.informatix.co.jp\/wp-content\/uploads\/2023\/08\/20230801-1-300x80.jpg 300w\" sizes=\"(max-width: 400px) 100vw, 400px\" \/><\/p>\n<p>\u7d50\u679c\u306f\u865a\u6570\u89e3\u306a\u306e\u3067<a href=\"https:\/\/club.informatix.co.jp\/?p=3233\" target=\"_blank\" rel=\"noopener\">\u865a\u6570i<\/a>\u304c\u3064\u3044\u3066\u3044\u307e\u3059\u3002<\/p>\n<h2><span class=\"ez-toc-section\" id=\"2%E6%AC%A1%E6%96%B9%E7%A8%8B%E5%BC%8Fax%C2%B2bxc0%E3%82%92%E8%A7%A3%E3%81%8F\"><\/span>2\u6b21\u65b9\u7a0b\u5f0fax\u00b2+bx+c=0\u3092\u89e3\u304f<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>SymPy\u306f\u4fc2\u6570\u304c\u30b7\u30f3\u30dc\u30ea\u30c3\u30af\u5909\u6570\u3067\u3042\u3063\u3066\u3082\u89e3\u304f\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<br \/>\n2\u6b21\u65b9\u7a0b\u5f0f<br \/>\nax\u00b2+bx+c=0<br \/>\n\u3092\u89e3\u3044\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>a\u3001b\u3001c\u3082\u30b7\u30f3\u30dc\u30ea\u30c3\u30af\u5909\u6570\u3068\u3057\u3066\u5b9a\u7fa9\u3059\u308b\u3060\u3051\u3067OK\u3067\u3059\u3002<br \/>\n&gt;&gt;&gt;\u00a0 import sympy<br \/>\n&gt;&gt;&gt;\u00a0 sympy.init_printing()<br \/>\n&gt;&gt;&gt;\u00a0 sympy.var(&#8216;x a b c&#8217;)<br \/>\n&gt;&gt;&gt;\u00a0 sympy.solve(a*x**2+b*x+c, x)<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-19038\" src=\"https:\/\/club.informatix.co.jp\/wp-content\/uploads\/2023\/08\/20230801-2.jpg\" alt=\"\" width=\"876\" height=\"189\" srcset=\"https:\/\/club.informatix.co.jp\/wp-content\/uploads\/2023\/08\/20230801-2.jpg 876w, https:\/\/club.informatix.co.jp\/wp-content\/uploads\/2023\/08\/20230801-2-300x65.jpg 300w, https:\/\/club.informatix.co.jp\/wp-content\/uploads\/2023\/08\/20230801-2-768x166.jpg 768w\" sizes=\"(max-width: 876px) 100vw, 876px\" \/><\/p>\n<p>\u591a\u6570\u306e\u5909\u6570\u3092\u30b7\u30f3\u30dc\u30ea\u30c3\u30af\u5909\u6570\u3068\u3057\u3066\u5b9a\u7fa9\u3059\u308b\u5834\u5408\u306b\u306fsympy.var()\u304c\u4fbf\u5229\u3067\u3059\u3002\u6700\u521d\u306e2\u6b21\u65b9\u7a0b\u5f0f\u306f\u30b7\u30f3\u30dc\u30ea\u30c3\u30af\u5909\u6570\u304cx\u3060\u3051\u306a\u306e\u3067sympy.solve()\u306b\u306f\u89e3\u304f\u3079\u304d\u5909\u6570\u3092\u7701\u7565\u3067\u304d\u307e\u3057\u305f\u3002\u3053\u306e2\u6b21\u65b9\u7a0b\u5f0f\u3067\u306f\u30b7\u30f3\u30dc\u30ea\u30c3\u30af\u5909\u6570\u304c4\u3064\u3042\u308b\u306e\u3067\u3069\u306e\u5909\u6570\u306b\u3064\u3044\u3066\u89e3\u304f\u304b\u3092\u7b2c2\u5f15\u6570\u306b\u6e21\u3057\u307e\u3059\u3002<\/p>\n<p>\u7d50\u679c\u306f2\u6b21\u65b9\u7a0b\u5f0f\u306e\u89e3\u306e\u516c\u5f0f\u305d\u306e\u3082\u306e\u3067\u3059\u3002<\/p>\n<h2><span class=\"ez-toc-section\" id=\"3%E6%AC%A1%E6%96%B9%E7%A8%8B%E5%BC%8Fax%C2%B3bx%C2%B2csd0%E3%82%92%E8%A7%A3%E3%81%8F\"><\/span>3\u6b21\u65b9\u7a0b\u5f0fax\u00b3+bx\u00b2+cs+d=0\u3092\u89e3\u304f<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>\u3067\u306f3\u6b21\u65b9\u7a0b\u5f0f\u306f\u3069\u3046\u3067\u3057\u3087\u3046\u304b\u3002<br \/>\n3\u6b21\u65b9\u7a0b\u5f0f<br \/>\nax\u00b3+bx\u00b2+cs+d=0<br \/>\n\u3092\u89e3\u3044\u3066\u307f\u307e\u3059\u3002<\/p>\n<p>\u30b7\u30f3\u30dc\u30ea\u30c3\u30af\u5909\u6570\u30921\u3064\u8ffd\u52a0\u3059\u308b\u3060\u3051\u3067\u3001\u3053\u308c\u307e\u3067\u3068\u540c\u3058\u3067\u3059\u3002<br \/>\n&gt;&gt;&gt;\u00a0 import sympy<br \/>\n&gt;&gt;&gt;\u00a0 sympy.init_printing()<br \/>\n&gt;&gt;&gt;\u00a0 sympy.var(&#8216;x a b c d&#8217;)<br \/>\n&gt;&gt;&gt;\u00a0 sympy.solve(a*x**3+b*x**2+c*x+d, x)<\/p>\n<p>\u305f\u3060\u3057\u30b3\u30f3\u30bd\u30fc\u30eb\u4e0a\u3067\u51fa\u529b\u3059\u308b\u3068\u7d50\u679c\u304c\u9577\u3059\u304e\u3066\u81ea\u7136\u6570\u5f0f\u8868\u793a\u3067\u3082\u5206\u304b\u308a\u3065\u3089\u304f\u306a\u308a\u307e\u3059\u3002\u305d\u3053\u3067Jupyer Notebook\u3067\u89e3\u3044\u3066\u307f\u307e\u3059\u3002<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-large wp-image-19039\" src=\"https:\/\/club.informatix.co.jp\/wp-content\/uploads\/2023\/08\/20230801-3-1024x185.jpg\" alt=\"\" width=\"920\" height=\"166\" srcset=\"https:\/\/club.informatix.co.jp\/wp-content\/uploads\/2023\/08\/20230801-3-1024x185.jpg 1024w, https:\/\/club.informatix.co.jp\/wp-content\/uploads\/2023\/08\/20230801-3-300x54.jpg 300w, https:\/\/club.informatix.co.jp\/wp-content\/uploads\/2023\/08\/20230801-3-768x139.jpg 768w, https:\/\/club.informatix.co.jp\/wp-content\/uploads\/2023\/08\/20230801-3-1536x278.jpg 1536w, https:\/\/club.informatix.co.jp\/wp-content\/uploads\/2023\/08\/20230801-3-2048x370.jpg 2048w\" sizes=\"(max-width: 920px) 100vw, 920px\" \/><\/p>\n<p>3\u3064\u306e\u89e3\u306e\u3046\u30611\u756a\u76ee\u306e\u89e3\u5168\u4f53\u3092\u898b\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u3053\u308c\u304c\u300c\u30ab\u30eb\u30c0\u30ce\u306e\u516c\u5f0f\u300d\u3067\u3059\u3002<\/p>\n<p>\u3053\u306e\u3088\u3046\u306bSymPy\u3092\u4f7f\u3048\u3070\u305f\u3063\u305f4\u884c\u306e\u30b3\u30fc\u30c9\u3067\u4ee3\u6570\u65b9\u7a0b\u5f0f\u3092\u89e3\u304f\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u6b21\u56de\u306f\u5f97\u3089\u308c\u305f\u65b9\u7a0b\u5f0f\u306e\u89e3\u3092\u5229\u7528\u3059\u308b\u65b9\u6cd5\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4ee3\u6570\u8a08\u7b97\u30e9\u30a4\u30d6\u30e9\u30eaSymPy\u306e\u30a4\u30f3\u30dd\u30fc\u30c8 SymPy\u306e\u3059\u3054\u3055\u3092\u4e00\u8a00\u3067\u8a00\u3044\u8868\u3059\u306a\u3089\u3070\u300c\u6570\u5b66\u306e\u7389\u624b\u7bb1\u300d\u3067\u3059\u3002SymPy\u306b\u304e\u3063\u3057\u308a\u8a70\u307e\u3063\u305f\u6570\u5b66\u3092Python\u3092\u901a\u3057\u3066\u4fbf\u5229\u306b\u5f15\u304d\u51fa\u3059\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002 \u4e2d\u5b66\u30fb\u9ad8\u6821 &#8230; <\/p>\n","protected":false},"author":4,"featured_media":19040,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,464,526],"tags":[65],"class_list":["post-19035","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-4","category-hito-star-mathmatics","category-526","tag-python"],"jetpack_featured_media_url":"https:\/\/club.informatix.co.jp\/wp-content\/uploads\/2023\/08\/20230801-1.jpg","_links":{"self":[{"href":"https:\/\/club.informatix.co.jp\/index.php?rest_route=\/wp\/v2\/posts\/19035","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/club.informatix.co.jp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/club.informatix.co.jp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/club.informatix.co.jp\/index.php?rest_route=\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/club.informatix.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=19035"}],"version-history":[{"count":6,"href":"https:\/\/club.informatix.co.jp\/index.php?rest_route=\/wp\/v2\/posts\/19035\/revisions"}],"predecessor-version":[{"id":20771,"href":"https:\/\/club.informatix.co.jp\/index.php?rest_route=\/wp\/v2\/posts\/19035\/revisions\/20771"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/club.informatix.co.jp\/index.php?rest_route=\/wp\/v2\/media\/19040"}],"wp:attachment":[{"href":"https:\/\/club.informatix.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=19035"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/club.informatix.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=19035"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/club.informatix.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=19035"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}