{"id":2975,"date":"2019-12-29T13:11:28","date_gmt":"2019-12-29T04:11:28","guid":{"rendered":"https:\/\/analysis-navi.com\/?p=2975"},"modified":"2025-06-08T21:34:10","modified_gmt":"2025-06-08T12:34:10","slug":"python%e3%81%a7%e5%8c%96%e5%ad%a6%e5%bc%8f%e3%82%92%e6%a7%8b%e6%88%90%e5%85%83%e7%b4%a0%e3%81%ab%e5%88%86%e8%a7%a3%e3%81%99%e3%82%8b","status":"publish","type":"post","link":"https:\/\/analysis-navi.com\/?p=2975","title":{"rendered":"Python\u3067\u5316\u5b66\u5f0f\u3092\u69cb\u6210\u5143\u7d20\u306b\u5206\u89e3\u3059\u308b"},"content":{"rendered":"\n<p>Python\u3092\u7528\u3044\u3066\u3001\u5316\u5b66\u5f0f\uff08\u7d44\u6210\u5f0f\uff09\u3092\u69cb\u6210\u5143\u7d20\u3068\u305d\u306e\u6570\u306b\u5206\u5272\u3059\u308b\u65b9\u6cd5\u3067\u3059\u3002<br>\u4f8b\u3048\u3070\u3001\u300cC16H10ClN3\u300d\u3068\u3044\u3046\u3088\u3046\u306b\u8a18\u8f09\u3055\u308c\u305f\u5316\u5b66\u5f0f\u3092\u3001{C:16,H:10,Cl:1,N:3}\u3068\u3044\u3046\u8f9e\u66f8\u30c7\u30fc\u30bf\u306b\u5206\u89e3\u3059\u308b\u3053\u3068\u3092\u30b4\u30fc\u30eb\u3068\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u95a2\u6570\u306e\u4f5c\u6210<\/h2>\n\n\n\n<p>\u5316\u5b66\u5f0f\u3092\u5165\u529b\u3057\u3066\u3001\u69cb\u6210\u8981\u7d20\u3092\u51fa\u529b\u3059\u308b\u95a2\u6570\u3092\u4f5c\u6210\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">def split_form(form):\n    form_d={}\n    for i in re.findall(r\"[A-Z][^A-Z]*\",form):\n        elem = re.match(r\"\\D+\", i).group()\n        num = i.replace(elem,\"\")\n        num = 1 if num == \"\" else num\n        form_d[elem] = num\n    return form_d\n<\/pre>\n\n\n\n<p>\u307e\u305a\u6b63\u898f\u8868\u73fe\u3092\u7528\u3044\u3066\u3001\u5927\u6587\u5b57\u3067\u59cb\u307e\u3063\u3066\u3044\u308b\u90e8\u5206\u306b\u3059\u3079\u3066\u5206\u89e3\u3057\u307e\u3059\u3002<br>\u305d\u306e\u5f8c\u3067\u3001\u305d\u306e\u90e8\u5206\u3092\u66f4\u306b\u82f1\u5b57\u90e8\u5206\u3068\u6570\u5b57\u90e8\u5206\u306b\u5206\u89e3\u3057\u3066\u3044\u307e\u3059\u3002\u6570\u5b57\u90e8\u5206\u306e\u306a\u3044\u3082\u306e\u306f1\u3068\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u5b9f\u884c\u7d50\u679c<\/h2>\n\n\n\n<p>\u5b9f\u884c\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">split_form(\"C15H15ClN2O3S\")<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">{'C': '15', 'H': '15', 'Cl': 1, 'N': '2', 'O': '3', 'S': 1}<\/pre>\n\n\n\n<p>\u3082\u30461\u3064\u3084\u3063\u3066\u307f\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">split_form(\"C11H6BrF3N4O2S\")<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">{'C': '11', 'H': '6', 'Br': 1, 'F': '3', 'N': '4', 'O': '2', 'S': 1}<\/pre>\n\n\n\n<p>\u6b63\u3057\u304f\u5206\u5272\u3067\u304d\u3066\u3044\u308b\u3088\u3046\u3067\u3059\u3002<br>\u62ec\u5f27\u3092\u542b\u3080\u8868\u8a18\u3084\u3001\u30a4\u30aa\u30f3\u3001\u96fb\u5b50\u5f0f\u306b\u306f\u5bfe\u5fdc\u3057\u3066\u304a\u308a\u307e\u305b\u3093\u306e\u3067\u3054\u6ce8\u610f\u304f\u3060\u3055\u3044\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Python\u3092\u7528\u3044\u3066\u3001\u5316\u5b66\u5f0f\uff08\u7d44\u6210\u5f0f\uff09\u3092\u69cb\u6210\u5143\u7d20\u3068\u305d\u306e\u6570\u306b\u5206\u5272\u3059\u308b\u65b9\u6cd5\u3067\u3059\u3002\u4f8b\u3048\u3070\u3001\u300cC16H10ClN3\u300d\u3068\u3044\u3046\u3088\u3046\u306b\u8a18\u8f09\u3055\u308c\u305f\u5316\u5b66\u5f0f\u3092\u3001{C:16,H:10,Cl:1,N:3}\u3068\u3044\u3046\u8f9e\u66f8\u30c7\u30fc\u30bf\u306b\u5206\u89e3\u3059\u308b\u3053\u3068\u3092\u30b4\u30fc\u30eb\u3068 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":4975,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"swell_btn_cv_data":"","vkexunit_cta_each_option":"","footnotes":""},"categories":[129],"tags":[134],"class_list":["post-2975","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-study","tag-python"],"_links":{"self":[{"href":"https:\/\/analysis-navi.com\/index.php?rest_route=\/wp\/v2\/posts\/2975","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/analysis-navi.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/analysis-navi.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/analysis-navi.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/analysis-navi.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2975"}],"version-history":[{"count":3,"href":"https:\/\/analysis-navi.com\/index.php?rest_route=\/wp\/v2\/posts\/2975\/revisions"}],"predecessor-version":[{"id":5058,"href":"https:\/\/analysis-navi.com\/index.php?rest_route=\/wp\/v2\/posts\/2975\/revisions\/5058"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/analysis-navi.com\/index.php?rest_route=\/wp\/v2\/media\/4975"}],"wp:attachment":[{"href":"https:\/\/analysis-navi.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2975"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/analysis-navi.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2975"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/analysis-navi.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2975"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}