{"id":2605,"date":"2025-10-29T19:49:23","date_gmt":"2025-10-29T10:19:23","guid":{"rendered":"https:\/\/softasia.jp\/blog\/?p=2605"},"modified":"2025-10-29T19:49:23","modified_gmt":"2025-10-29T10:19:23","slug":"python%e5%85%a5%e9%96%80%ef%bc%81-%e6%96%87%e5%ad%97%e5%88%97%e7%bd%ae%e6%8f%9b%e3%81%ae%e5%bf%85%e9%a0%88%e3%82%b9%e3%82%ad%e3%83%ab%ef%bc%81replace%e3%83%a1%e3%82%bd%e3%83%83%e3%83%89%e3%81%ae","status":"publish","type":"post","link":"https:\/\/softasia.jp\/blog\/offshore\/2605\/","title":{"rendered":"Python\u5165\u9580\uff01 \u6587\u5b57\u5217\u7f6e\u63db\u306e\u5fc5\u9808\u30b9\u30ad\u30eb\uff01replace\u30e1\u30bd\u30c3\u30c9\u306e\u4f7f\u3044\u65b9\u3092\u5fb9\u5e95\u89e3\u8aac"},"content":{"rendered":"<p><img loading=\"lazy\" class=\"size-medium wp-image-2609 aligncenter\" src=\"https:\/\/softasia.jp\/blog\/wp-content\/uploads\/2025\/09\/SOFT_ASIA_\u30a2\u30a4\u30ad\u30e3\u30c3\u30c1-11-300x169.png\" alt=\"\" width=\"300\" height=\"169\" srcset=\"https:\/\/softasia.jp\/blog\/wp-content\/uploads\/2025\/09\/SOFT_ASIA_\u30a2\u30a4\u30ad\u30e3\u30c3\u30c1-11-300x169.png 300w, https:\/\/softasia.jp\/blog\/wp-content\/uploads\/2025\/09\/SOFT_ASIA_\u30a2\u30a4\u30ad\u30e3\u30c3\u30c1-11-1024x576.png 1024w, https:\/\/softasia.jp\/blog\/wp-content\/uploads\/2025\/09\/SOFT_ASIA_\u30a2\u30a4\u30ad\u30e3\u30c3\u30c1-11-768x432.png 768w, https:\/\/softasia.jp\/blog\/wp-content\/uploads\/2025\/09\/SOFT_ASIA_\u30a2\u30a4\u30ad\u30e3\u30c3\u30c1-11-1536x864.png 1536w, https:\/\/softasia.jp\/blog\/wp-content\/uploads\/2025\/09\/SOFT_ASIA_\u30a2\u30a4\u30ad\u30e3\u30c3\u30c1-11.png 2048w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">Python\u3067\u6587\u5b57\u5217\u3092\u51e6\u7406\u3059\u308b\u3068\u304d\u306b\u3001\u6700\u3082\u3088\u304f\u4f7f\u308f\u308c\u308b\u6a5f\u80fd\u306e\u4e00\u3064\u304c<\/span><span style=\"color: #ff0000;\">replace\u30e1\u30bd\u30c3\u30c9<\/span><span style=\"font-weight: 400;\">\u3067\u3059\u3002<\/span><span style=\"font-weight: 400;\"><strong>\u300c<span style=\"text-decoration: underline;\">\u7279\u5b9a\u306e\u6587\u5b57\u3084\u5358\u8a9e\u3092\u307e\u3068\u3081\u3066\u5909\u3048\u305f\u3044<\/span>\u300d\u300c<span style=\"text-decoration: underline;\">\u4f59\u8a08\u306a\u8a18\u53f7\u3092\u6d88\u3057\u305f\u3044<\/span>\u300d\u300c<span style=\"text-decoration: underline;\">\u7f6e\u63db\u56de\u6570\u3092\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u3057\u305f\u3044<\/span>\u300d<\/strong>\u3068\u3044\u3063\u305f\u30cb\u30fc\u30ba\u306b\u5fdc\u3048\u3066\u304f\u308c\u308b\u306e\u304c <span style=\"color: #ff0000;\">str.replace()<\/span>\u3067\u3059\u3002<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">\u3053\u306e\u8a18\u4e8b\u3067\u306f\u3001<\/span>\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u521d\u5fc3\u8005\u306e\u65b9\u3067\u3082\u30b9\u30c3\u3068\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u306b<span style=\"font-weight: 400;\">\u3001\u57fa\u672c\u69cb\u6587\u304b\u3089\u5b9f\u52d9\u3067\u5f79\u7acb\u3064\u30c6\u30af\u30cb\u30c3\u30af\u307e\u3067\u3001\u308f\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/span><\/p>\n<div id=\"toc_container\" class=\"no_bullets\"><p class=\"toc_title\">\u76ee\u6b21<\/p><ul class=\"toc_list\"><li><a href=\"#replace\"><span class=\"toc_number toc_depth_1\">1<\/span> replace\u30e1\u30bd\u30c3\u30c9\u306e\u57fa\u672c<\/a><ul><li><a href=\"#i\"><span class=\"toc_number toc_depth_2\">1.1<\/span> \u90e8\u5206\u7684\u306b\u7f6e\u63db\u3059\u308b\u65b9\u6cd5<\/a><\/li><li><a href=\"#i-2\"><span class=\"toc_number toc_depth_2\">1.2<\/span> \u7f6e\u63db\u524d\u5f8c\u306e\u30c1\u30a7\u30c3\u30af\u65b9\u6cd5<\/a><\/li><li><a href=\"#i-3\"><span class=\"toc_number toc_depth_2\">1.3<\/span> \u8907\u6570\u306e\u6587\u5b57\u5217\u3092\u307e\u3068\u3081\u3066\u7f6e\u63db\u3059\u308b\u65b9\u6cd5<\/a><\/li><\/ul><\/li><li><a href=\"#i-4\"><span class=\"toc_number toc_depth_1\">2<\/span> \u5b9f\u52d9\u3067\u5f79\u7acb\u3064\u7f6e\u63db\u30c6\u30af\u30cb\u30c3\u30af\u96c6<\/a><\/li><li><a href=\"#replaceresub\"><span class=\"toc_number toc_depth_1\">3<\/span> replace\u3068\u6b63\u898f\u8868\u73fere.sub\u306e\u9055\u3044<\/a><\/li><li><a href=\"#i-5\"><span class=\"toc_number toc_depth_1\">4<\/span> \u5b9f\u52d9\u3067\u3042\u308a\u304c\u3061\u306a\u30a8\u30e9\u30fc\u3068\u5bfe\u7b56<\/a><ul><li><a href=\"#AttributeError\"><span class=\"toc_number toc_depth_2\">4.1<\/span> AttributeError \u304c\u51fa\u308b\u5834\u5408\u306e\u5bfe\u51e6\u6cd5<\/a><\/li><li><a href=\"#i-6\"><span class=\"toc_number toc_depth_2\">4.2<\/span> \u6587\u5b57\u30b3\u30fc\u30c9\u306b\u3088\u308b\u7f6e\u63db\u30df\u30b9\u306e\u56de\u907f<\/a><\/li><li><a href=\"#i-7\"><span class=\"toc_number toc_depth_2\">4.3<\/span> \u6761\u4ef6\u5206\u5c90\u3067\u4e0d\u8981\u306a\u7f6e\u63db\u3092\u9632\u3050\u65b9\u6cd5<\/a><\/li><\/ul><\/li><li><a href=\"#QA\"><span class=\"toc_number toc_depth_1\">5<\/span> \u3088\u304f\u3042\u308b\u7591\u554fQ&amp;A<\/a><ul><li><a href=\"#i-8\"><span class=\"toc_number toc_depth_2\">5.1<\/span> \u7f6e\u63db\u7d50\u679c\u3092\u540c\u3058\u5909\u6570\u306b\u4e0a\u66f8\u304d\u3057\u3066\u3044\u3044\u3067\u3059\u304b\uff1f<\/a><\/li><li><a href=\"#i-9\"><span class=\"toc_number toc_depth_2\">5.2<\/span> \u5168\u89d2\u30b9\u30da\u30fc\u30b9\u3084\u534a\u89d2\u30b9\u30da\u30fc\u30b9\u3092\u307e\u3068\u3081\u3066\u7f6e\u63db\u3059\u308b\u65b9\u6cd5\u306f\u3042\u308a\u307e\u3059\u304b\uff1f<\/a><\/li><li><a href=\"#Q3\"><span class=\"toc_number toc_depth_2\">5.3<\/span> Q3. \u4e00\u5ea6\u306b\u8907\u6570\u306e\u6761\u4ef6\u3067\u6587\u5b57\u5217\u3092\u7f6e\u63db\u3059\u308b\u65b9\u6cd5\u306f\uff1f<\/a><\/li><\/ul><\/li><li><a href=\"#i-10\"><span class=\"toc_number toc_depth_1\">6<\/span> \u307e\u3068\u3081<\/a><\/li><\/ul><\/div>\n<h2><span id=\"replace\"><span style=\"font-weight: 400;\">replace\u30e1\u30bd\u30c3\u30c9\u306e\u57fa\u672c<\/span><\/span><\/h2>\n<p><img loading=\"lazy\" class=\"size-medium wp-image-2611 aligncenter\" src=\"https:\/\/softasia.jp\/blog\/wp-content\/uploads\/2025\/09\/SOFT-_ASIA-41-300x200.png\" alt=\"\" width=\"300\" height=\"200\" srcset=\"https:\/\/softasia.jp\/blog\/wp-content\/uploads\/2025\/09\/SOFT-_ASIA-41-300x200.png 300w, https:\/\/softasia.jp\/blog\/wp-content\/uploads\/2025\/09\/SOFT-_ASIA-41.png 640w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><b>\u57fa\u672c\u69cb\u6587<\/b><\/p>\n<p><span style=\"font-weight: 400;\">\u6587\u5b57\u5217.replace(old, new, count)<\/span><\/p>\n<p>&nbsp;<\/p>\n<ul>\n<li style=\"font-weight: 400;\"><b>old<\/b><span style=\"font-weight: 400;\">\uff1a\u7f6e\u304d\u63db\u3048\u305f\u3044\u6587\u5b57\u5217<\/span><\/li>\n<li style=\"font-weight: 400;\"><b>new<\/b><span style=\"font-weight: 400;\">\uff1a\u65b0\u3057\u3044\u6587\u5b57\u5217<\/span><\/li>\n<li style=\"font-weight: 400;\"><b>count\uff08\u7701\u7565\u53ef\uff09<\/b><span style=\"font-weight: 400;\">\uff1a\u7f6e\u63db\u3059\u308b\u56de\u6570\u3002\u7701\u7565\u3059\u308b\u3068\u5168\u3066\u7f6e\u63db<\/span><\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p><b>\u57fa\u672c\u7684\u306a\u4f7f\u3044\u65b9<\/b><\/p>\n<p><span style=\"font-weight: 400; color: #0000ff;\">text = &#8220;I like apples.&#8221;<\/span><\/p>\n<p><span style=\"font-weight: 400; color: #0000ff;\">new_text = text.replace(&#8220;apples&#8221;, &#8220;oranges&#8221;)<\/span><\/p>\n<p><span style=\"font-weight: 400; color: #0000ff;\">print(new_text)\u00a0 # I like oranges.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">\u30dd\u30a4\u30f3\u30c8\u306f\u3001<\/span><span style=\"text-decoration: underline;\"><strong>\u5143\u306e\u6587\u5b57\u5217\u306f\u5909\u66f4\u3055\u308c\u305a\u3001\u65b0\u3057\u3044\u6587\u5b57\u5217\u304c\u8fd4\u3063\u3066\u304f\u308b<\/strong><\/span><span style=\"font-weight: 400;\"><span style=\"text-decoration: underline;\"><strong>\u3053\u3068\u3067\u3059<\/strong><\/span>\u3002\u65e2\u5b58\u306e\u5909\u6570\u306b\u4e0a\u66f8\u304d\u3057\u305f\u3044\u5834\u5408\u306f text = text.replace(&#8230;) \u3068\u66f8\u3051\u3070OK\u3067\u3059\u3002<\/span><\/p>\n<p>&nbsp;<\/p>\n<h3><span id=\"i\"><span style=\"font-weight: 400;\">\u90e8\u5206\u7684\u306b\u7f6e\u63db\u3059\u308b\u65b9\u6cd5<\/span><\/span><\/h3>\n<p><b>\u5148\u982d\u304b\u3089\u6307\u5b9a\u56de\u6570\u3060\u3051\u7f6e\u63db<\/b><\/p>\n<p><span style=\"font-weight: 400; color: #0000ff;\">text = &#8220;apple apple apple&#8221;<\/span><\/p>\n<p><span style=\"font-weight: 400; color: #0000ff;\">new_text = text.replace(&#8220;apple&#8221;, &#8220;orange&#8221;, 2)<\/span><\/p>\n<p><span style=\"font-weight: 400; color: #0000ff;\">print(new_text)\u00a0 # orange orange apple<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">count\u306b\u300c2\u300d\u3092\u6307\u5b9a\u3059\u308b\u3068\u3001\u5148\u982d\u304b\u30892\u56de\u3060\u3051\u7f6e\u63db\u3055\u308c\u307e\u3059\u3002<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><b>\u5927\u6587\u5b57\u30fb\u5c0f\u6587\u5b57\u306b\u6ce8\u610f<\/b><\/p>\n<p><span style=\"font-weight: 400;\">replace<\/span><b>\u306f\u5927\u6587\u5b57\u30fb\u5c0f\u6587\u5b57\u3092\u533a\u5225\u3057\u307e\u3059\u3002<\/b><\/p>\n<p><span style=\"font-weight: 400; color: #0000ff;\">text = &#8220;Python python PyThOn&#8221;<\/span><\/p>\n<p><span style=\"font-weight: 400; color: #0000ff;\">print(text.replace(&#8220;python&#8221;, &#8220;Java&#8221;))\u00a0 # Python Java PyThOn<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">\u5168\u90e8\u7f6e\u63db\u3057\u305f\u3044\u5834\u5408\u306f\u3001\u3042\u3089\u304b\u3058\u3081 lower() \u3084 upper() \u3067\u6587\u5b57\u5217\u3092\u7d71\u4e00\u3059\u308b\u306e\u304c\u30b3\u30c4\u3067\u3059\u3002<\/span><\/p>\n<p>&nbsp;<\/p>\n<h3><span id=\"i-2\"><span style=\"font-weight: 400;\">\u7f6e\u63db\u524d\u5f8c\u306e\u30c1\u30a7\u30c3\u30af\u65b9\u6cd5<\/span><\/span><\/h3>\n<p><span style=\"font-weight: 400;\"><span style=\"text-decoration: underline;\">\u30c7\u30fc\u30bf\u6574\u5f62\u3084\u81ea\u52d5\u51e6\u7406\u3067\u306f\u3001\u7f6e\u63db\u7d50\u679c\u3092\u691c\u8a3c\u3059\u308b\u3053\u3068\u304c\u91cd\u8981\u3067\u3059<\/span>\u3002<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400; color: #0000ff;\">original = &#8220;price: $100&#8221;<\/span><\/p>\n<p><span style=\"font-weight: 400; color: #0000ff;\">converted = original.replace(&#8220;$&#8221;,&#8221;\uffe5&#8221;)<\/span><\/p>\n<p><span style=\"font-weight: 400; color: #0000ff;\">if original != converted:<\/span><\/p>\n<p><span style=\"font-weight: 400; color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0print(&#8220;\u7f6e\u63db\u3055\u308c\u307e\u3057\u305f:&#8221;, converted)<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">\u7f6e\u63db\u304c\u6b63\u3057\u304f\u884c\u308f\u308c\u305f\u304b\u3069\u3046\u304b\u3092\u81ea\u52d5\u3067\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002<\/span><\/p>\n<p>&nbsp;<\/p>\n<h3><span id=\"i-3\"><span style=\"font-weight: 400;\">\u8907\u6570\u306e\u6587\u5b57\u5217\u3092\u307e\u3068\u3081\u3066\u7f6e\u63db\u3059\u308b\u65b9\u6cd5<\/span><\/span><\/h3>\n<p><b>\u9023\u7d9a\u3057\u3066replace\u3092\u4f7f\u3046<\/b><\/p>\n<p><span style=\"font-weight: 400; color: #0000ff;\">text = &#8220;red green blue&#8221;<\/span><\/p>\n<p><span style=\"font-weight: 400; color: #0000ff;\">text = text.replace(&#8220;red&#8221;, &#8220;RED&#8221;).replace(&#8220;green&#8221;, &#8220;GREEN&#8221;)<\/span><\/p>\n<p><span style=\"font-weight: 400; color: #0000ff;\">print(text)<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">\u30b7\u30f3\u30d7\u30eb\u306a\u5834\u5408\u306f\u9023\u7d9a\u3057\u3066\u66f8\u3051\u3070OK\u3067\u3059\u3002<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><b>\u8f9e\u66f8\uff0b\u30eb\u30fc\u30d7\u3067\u4e00\u62ec\u7f6e\u63db<\/b><\/p>\n<p><span style=\"font-weight: 400; color: #0000ff;\">text = &#8220;I like apples and bananas.&#8221;<\/span><\/p>\n<p><span style=\"font-weight: 400; color: #0000ff;\">replacements = {&#8220;apples&#8221;:&#8221;oranges&#8221;,&#8221;bananas&#8221;:&#8221;grapes&#8221;}<\/span><\/p>\n<p><span style=\"font-weight: 400; color: #0000ff;\">for old,new in replacements.items():<\/span><\/p>\n<p><span style=\"font-weight: 400; color: #0000ff;\">\u00a0\u00a0\u00a0\u00a0text = text.replace(old,new)<\/span><\/p>\n<p><span style=\"font-weight: 400; color: #0000ff;\">print(text)<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">\u8907\u6570\u306e\u5358\u8a9e\u3092\u4e00\u5ea6\u306b\u5909\u3048\u305f\u3044\u5834\u5408\u306b\u4fbf\u5229\u3067\u3059\u3002<\/span><\/p>\n<p>&nbsp;<\/p>\n<h2><\/h2>\n<p>&nbsp;<\/p>\n<h2><span id=\"i-4\"><span style=\"font-weight: 400;\">\u5b9f\u52d9\u3067\u5f79\u7acb\u3064\u7f6e\u63db\u30c6\u30af\u30cb\u30c3\u30af\u96c6<\/span><\/span><\/h2>\n<p><img loading=\"lazy\" class=\"size-medium wp-image-2617 aligncenter\" src=\"https:\/\/softasia.jp\/blog\/wp-content\/uploads\/2025\/09\/SOFT-_ASIA-43-300x200.png\" alt=\"\" width=\"300\" height=\"200\" srcset=\"https:\/\/softasia.jp\/blog\/wp-content\/uploads\/2025\/09\/SOFT-_ASIA-43-300x200.png 300w, https:\/\/softasia.jp\/blog\/wp-content\/uploads\/2025\/09\/SOFT-_ASIA-43.png 640w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><b>\u8a18\u53f7\u3084\u6570\u5b57\u306e\u524a\u9664\u30fb\u5909\u63db<\/b><\/p>\n<p><span style=\"font-weight: 400; color: #0000ff;\">text = &#8220;TEL:03-1234-5678&#8221;<\/span><\/p>\n<p><span style=\"font-weight: 400; color: #0000ff;\">print(text.replace(&#8220;-&#8220;, &#8220;&#8221;))\u00a0 # TEL:0312345678<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">\u96fb\u8a71\u756a\u53f7\u306a\u3069\u306e\u30cf\u30a4\u30d5\u30f3\u3092\u307e\u3068\u3081\u3066\u524a\u9664\u3067\u304d\u307e\u3059\u3002<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><b>\u6539\u884c\u30fb\u30bf\u30d6\u6587\u5b57\u3092\u524a\u9664<\/b><\/p>\n<p><span style=\"font-weight: 400; color: #0000ff;\">text = &#8220;Hello\\nWorld\\t!&#8221;<\/span><\/p>\n<p><span style=\"font-weight: 400; color: #0000ff;\">cleaned = text.replace(&#8220;\\n&#8221;, &#8221; &#8220;).replace(&#8220;\\t&#8221;, &#8221; &#8220;)<\/span><\/p>\n<p><span style=\"font-weight: 400; color: #0000ff;\">print(cleaned)<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">\u6539\u884c\u30fb\u30bf\u30d6\u6587\u5b57\u3092\u7a7a\u767d\u306b\u7f6e\u63db\u3059\u308c\u3070\u3001\u6574\u5f62\u3055\u308c\u305f1\u884c\u30c6\u30ad\u30b9\u30c8\u304c\u4f5c\u308c\u307e\u3059\u3002<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><b>CSV\u3084\u30ed\u30b0\u306e\u6574\u5f62<\/b><\/p>\n<p><span style=\"font-weight: 400; color: #0000ff;\">row = &#8220;Alice,25,Female&#8221;<\/span><\/p>\n<p><span style=\"font-weight: 400; color: #0000ff;\">print(row.replace(&#8220;,&#8221;, &#8220;\\t&#8221;))\u00a0 # \u30bf\u30d6\u533a\u5207\u308a\u306b\u5909\u63db<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">\u30ed\u30b0\u89e3\u6790\u3084\u30c7\u30fc\u30bf\u30af\u30ec\u30f3\u30b8\u30f3\u30b0\u3067\u4fbf\u5229\u3067\u3059\u3002<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><b>\u30ea\u30b9\u30c8\u5185\u3067\u306e\u4e00\u62ec\u7f6e\u63db<\/b><\/p>\n<p><span style=\"font-weight: 400; color: #0000ff;\">words = [&#8220;apple&#8221;,&#8221;banana&#8221;,&#8221;apple&#8221;]<\/span><\/p>\n<p><span style=\"font-weight: 400; color: #0000ff;\">words = [w.replace(&#8220;apple&#8221;,&#8221;orange&#8221;) for w in words]<\/span><\/p>\n<p><span style=\"font-weight: 400; color: #0000ff;\">print(words)<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">\u30ea\u30b9\u30c8\u5185\u5305\u8868\u8a18\u3067\u4e00\u6c17\u306b\u7f6e\u63db\u3067\u304d\u307e\u3059\u3002<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><b>pandas\u3067\u306e\u4e00\u62ec\u7f6e\u63db<\/b><\/p>\n<p><span style=\"font-weight: 400; color: #0000ff;\">import pandas as pd<\/span><\/p>\n<p><span style=\"font-weight: 400; color: #0000ff;\">df = pd.DataFrame({&#8220;fruit&#8221;: [&#8220;apple&#8221;, &#8220;banana&#8221;, &#8220;apple&#8221;]})<\/span><\/p>\n<p><span style=\"font-weight: 400; color: #0000ff;\">df[&#8220;fruit&#8221;] = df[&#8220;fruit&#8221;].str.replace(&#8220;apple&#8221;, &#8220;orange&#8221;)<\/span><\/p>\n<p><span style=\"font-weight: 400; color: #0000ff;\">print(df)<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\"># \u8f9e\u66f8\u3092\u4f7f\u3063\u305f\u8907\u6570\u7f6e\u63db<\/span><\/p>\n<p><span style=\"font-weight: 400; color: #0000ff;\">df = df.replace({&#8220;fruit&#8221;: {&#8220;banana&#8221;: &#8220;grape&#8221;, &#8220;orange&#8221;: &#8220;melon&#8221;}})<\/span><\/p>\n<p><span style=\"font-weight: 400; color: #0000ff;\">print(df)<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u5927\u91cf\u30c7\u30fc\u30bf\u3092\u6271\u3046\u5834\u5408\u3001pandas\u3092\u4f7f\u3046\u3068\u9ad8\u901f\u304b\u3064\u7c21\u5358\u3067\u3059\u3002<\/span><\/p>\n<p>&nbsp;<\/p>\n<h2><span id=\"replaceresub\"><span style=\"font-weight: 400;\">replace\u3068\u6b63\u898f\u8868\u73fere.sub\u306e\u9055\u3044<\/span><\/span><\/h2>\n<p><img loading=\"lazy\" class=\"size-medium wp-image-2620 aligncenter\" src=\"https:\/\/softasia.jp\/blog\/wp-content\/uploads\/2025\/09\/SOFT-_ASIA-44-300x200.png\" alt=\"\" width=\"300\" height=\"200\" srcset=\"https:\/\/softasia.jp\/blog\/wp-content\/uploads\/2025\/09\/SOFT-_ASIA-44-300x200.png 300w, https:\/\/softasia.jp\/blog\/wp-content\/uploads\/2025\/09\/SOFT-_ASIA-44.png 640w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\"><span style=\"text-decoration: underline;\">replace\u306f\u56fa\u5b9a\u6587\u5b57\u5217\u3057\u304b\u6271\u3048\u307e\u305b\u3093\u304c\u3001\u30d1\u30bf\u30fc\u30f3\u306b\u30de\u30c3\u30c1\u3059\u308b\u6587\u5b57\u5217\u3092\u7f6e\u63db\u3057\u305f\u3044\u5834\u5408\u306fre.sub\u304c\u4fbf\u5229\u3067\u3059<\/span>\u3002<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400; color: #0000ff;\">import re<\/span><\/p>\n<p><span style=\"font-weight: 400; color: #0000ff;\">text = &#8220;My number is 123-456-7890.&#8221;<\/span><\/p>\n<p><span style=\"font-weight: 400; color: #0000ff;\">new_text = re.sub(r&#8221;\\d&#8221;, &#8220;X&#8221;, text)<\/span><\/p>\n<p><span style=\"font-weight: 400; color: #0000ff;\">print(new_text)\u00a0 # My number is XXX-XXX-XXXX.<\/span><\/p>\n<p>&nbsp;<\/p>\n<ul>\n<li style=\"font-weight: 400;\"><b>replace<\/b><span style=\"font-weight: 400;\">\uff1a\u5358\u7d14\u306a\u7f6e\u63db\u306b\u9ad8\u901f<\/span><\/li>\n<li style=\"font-weight: 400;\"><b>re.sub<\/b><span style=\"font-weight: 400;\">\uff1a\u6b63\u898f\u8868\u73fe\u30d1\u30bf\u30fc\u30f3\u306b\u67d4\u8edf\u306b\u5bfe\u5fdc<\/span><\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">\u8907\u96d1\u306a\u6761\u4ef6\u7f6e\u63db\u3092\u3057\u305f\u3044\u3068\u304d\u306f re.sub \u3092\u4f7f\u3044\u307e\u3057\u3087\u3046\u3002<\/span><\/p>\n<p>&nbsp;<\/p>\n<h2><span id=\"i-5\"><span style=\"font-weight: 400;\">\u5b9f\u52d9\u3067\u3042\u308a\u304c\u3061\u306a\u30a8\u30e9\u30fc\u3068\u5bfe\u7b56<\/span><\/span><\/h2>\n<p><img loading=\"lazy\" class=\"size-medium wp-image-2628 aligncenter\" src=\"https:\/\/softasia.jp\/blog\/wp-content\/uploads\/2025\/09\/SOFT-_ASIA-45-300x200.png\" alt=\"\" width=\"300\" height=\"200\" srcset=\"https:\/\/softasia.jp\/blog\/wp-content\/uploads\/2025\/09\/SOFT-_ASIA-45-300x200.png 300w, https:\/\/softasia.jp\/blog\/wp-content\/uploads\/2025\/09\/SOFT-_ASIA-45.png 640w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/p>\n<h3><\/h3>\n<h3><span id=\"AttributeError\"><b>AttributeError \u304c\u51fa\u308b\u5834\u5408\u306e\u5bfe\u51e6\u6cd5<\/b><\/span><\/h3>\n<p>replace()\u30e1\u30bd\u30c3\u30c9\u306f\u300c\u6587\u5b57\u5217\u300d\u5c02\u7528\u3067\u3059\u3002None\u3084\u6570\u5024\u306a\u3069\u3001\u6587\u5b57\u5217\u4ee5\u5916\u306e\u30c7\u30fc\u30bf\u306b\u5bfe\u3057\u3066\u4f7f\u3046\u3068<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #0000ff;\">AttributeError: &#8216;NoneType&#8217; object has no attribute &#8216;replace&#8217;<\/span><\/p>\n<p>&nbsp;<\/p>\n<p>\u306e\u3088\u3046\u306a\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u30a8\u30e9\u30fc\u3092\u9632\u3050\u306b\u306f\u3001\u4e8b\u524d\u306b\u578b\u3092\u30c1\u30a7\u30c3\u30af\u3057\u305f\u308a\u3001\u6587\u5b57\u5217\u306b\u5909\u63db\u3057\u3066\u304b\u3089replace()\u3092\u4f7f\u3044\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #0000ff;\">value = None<\/span><\/p>\n<p><span style=\"color: #0000ff;\"># \u578b\u3092\u30c1\u30a7\u30c3\u30af\u3057\u3066\u304b\u3089replace\u3092\u5b9f\u884c<\/span><\/p>\n<p><span style=\"color: #0000ff;\">if isinstance(value, str):<\/span><\/p>\n<p><span style=\"color: #0000ff;\"><span class=\"Apple-converted-space\">\u00a0 \u00a0 <\/span>value = value.replace(&#8220;old&#8221;, &#8220;new&#8221;)<\/span><\/p>\n<p><span style=\"color: #0000ff;\">else:<\/span><\/p>\n<p><span style=\"color: #0000ff;\"><span class=\"Apple-converted-space\">\u00a0 \u00a0 <\/span>print(&#8220;\u6587\u5b57\u5217\u3067\u306f\u3042\u308a\u307e\u305b\u3093&#8221;)<\/span><\/p>\n<p># \u3082\u3057\u304f\u306f\u6587\u5b57\u5217\u306b\u5909\u63db\u3057\u3066\u304b\u3089\u7f6e\u63db<\/p>\n<p><span style=\"color: #0000ff;\">value = str(value).replace(&#8220;old&#8221;, &#8220;new&#8221;)<\/span><\/p>\n<p>&nbsp;<\/p>\n<h3><span id=\"i-6\"><b>\u6587\u5b57\u30b3\u30fc\u30c9\u306b\u3088\u308b\u7f6e\u63db\u30df\u30b9\u306e\u56de\u907f<\/b><\/span><\/h3>\n<p>\u5168\u89d2\u30fb\u534a\u89d2\u3084\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u306e\u9055\u3044\u306b\u3088\u308a\u3001\u60f3\u5b9a\u901a\u308a\u306b\u7f6e\u63db\u3055\u308c\u306a\u3044\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #0000ff;\">text = &#8220;\u3053\u3093\u306b\u3061\u306f\u3000\u4e16\u754c&#8221;<span class=\"Apple-converted-space\">\u00a0 <\/span># \u5168\u89d2\u30b9\u30da\u30fc\u30b9\u3042\u308a<\/span><\/p>\n<p><span style=\"color: #0000ff;\">print(text.replace(&#8221; &#8220;, &#8220;_&#8221;))<span class=\"Apple-converted-space\">\u00a0 <\/span># \u534a\u89d2\u30b9\u30da\u30fc\u30b9\u3092\u7f6e\u63db \u2192 \u5168\u89d2\u306f\u7f6e\u63db\u3055\u308c\u306a\u3044<\/span><\/p>\n<p>&nbsp;<\/p>\n<p>\u3053\u306e\u5834\u5408\u3001\u5168\u89d2\u30b9\u30da\u30fc\u30b9\u300c\u3000\u300d\u3068\u534a\u89d2\u30b9\u30da\u30fc\u30b9\u300c \u300d\u3092\u5225\u3005\u306b\u6307\u5b9a\u3059\u308b\u304b\u3001\u4e8b\u524d\u306b\u6587\u5b57\u30b3\u30fc\u30c9\u3092\u7d71\u4e00\u3057\u307e\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<p># \u6587\u5b57\u30b3\u30fc\u30c9\u3092\u7d71\u4e00\u3059\u308b\u4f8b<\/p>\n<p><span style=\"color: #0000ff;\">text = text.encode(&#8220;utf-8&#8221;).decode(&#8220;utf-8&#8221;)<\/span><\/p>\n<p><span style=\"color: #0000ff;\">text = text.replace(&#8220;\u3000&#8221;, &#8221; &#8220;)<span class=\"Apple-converted-space\">\u00a0 <\/span># \u5168\u89d2\u30b9\u30da\u30fc\u30b9\u3092\u534a\u89d2\u306b\u7f6e\u63db<\/span><\/p>\n<p>&nbsp;<\/p>\n<p>\u3053\u3046\u3057\u3066\u304a\u304f\u3068\u3001\u6587\u5b57\u30b3\u30fc\u30c9\u306e\u9055\u3044\u306b\u3088\u308b\u7f6e\u63db\u6f0f\u308c\u3092\u9632\u304e\u3084\u3059\u304f\u306a\u308a\u307e\u3059\u3002<\/p>\n<h3><\/h3>\n<h3><span id=\"i-7\"><b>\u6761\u4ef6\u5206\u5c90\u3067\u4e0d\u8981\u306a\u7f6e\u63db\u3092\u9632\u3050\u65b9\u6cd5<\/b><\/span><\/h3>\n<p>\u300c\u7279\u5b9a\u306e\u6761\u4ef6\u306e\u3068\u304d\u3060\u3051\u7f6e\u63db\u3057\u305f\u3044\u300d\u5834\u5408\u306f\u3001if\u6587\u3092\u4f7f\u3063\u3066\u6761\u4ef6\u3092\u3064\u3051\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #0000ff;\">text = &#8220;Price: $100&#8221;<\/span><\/p>\n<p><span style=\"color: #0000ff;\"># $ \u304c\u542b\u307e\u308c\u3066\u3044\u308b\u3068\u304d\u3060\u3051\u7f6e\u63db\u3059\u308b<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #0000ff;\">if &#8220;$&#8221; in text:<\/span><\/p>\n<p><span style=\"color: #0000ff;\"><span class=\"Apple-converted-space\">\u00a0 \u00a0 <\/span>text = text.replace(&#8220;$&#8221;, &#8220;\uffe5&#8221;)<\/span><\/p>\n<p><span style=\"color: #0000ff;\">print(text)<span class=\"Apple-converted-space\">\u00a0 <\/span># Price: \uffe5100<\/span><\/p>\n<p>&nbsp;<\/p>\n<p>\u3053\u306e\u3088\u3046\u306b\u6761\u4ef6\u5206\u5c90\u3092\u7d44\u307f\u5408\u308f\u305b\u308b\u3053\u3068\u3067\u3001\u5fc5\u8981\u306a\u3068\u304d\u3060\u3051\u5b89\u5168\u306b\u7f6e\u63db\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u3053\u306e\u3088\u3046\u306b\u300c<span style=\"text-decoration: underline;\"><strong>\u578b\u30c1\u30a7\u30c3\u30af<\/strong><\/span>\u300d\u300c<span style=\"text-decoration: underline;\"><strong>\u6587\u5b57\u30b3\u30fc\u30c9\u7d71\u4e00<\/strong><\/span>\u300d\u300c<span style=\"text-decoration: underline;\"><strong>\u6761\u4ef6\u5206\u5c90<\/strong><\/span>\u300d\u3092\u610f\u8b58\u3057\u3066\u304a\u304f\u3068\u3001\u5b9f\u52d9\u30ec\u30d9\u30eb\u3067\u3082replace()\u3092\u3088\u308a\u5b89\u5fc3\u3057\u3066\u4f7f\u3048\u307e\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<h2><span id=\"QA\"><span style=\"font-weight: 400;\">\u3088\u304f\u3042\u308b\u7591\u554fQ&amp;A<\/span><\/span><\/h2>\n<p><img loading=\"lazy\" class=\"size-medium wp-image-2613 aligncenter\" src=\"https:\/\/softasia.jp\/blog\/wp-content\/uploads\/2025\/09\/SOFT-_ASIA-42-300x200.png\" alt=\"\" width=\"300\" height=\"200\" srcset=\"https:\/\/softasia.jp\/blog\/wp-content\/uploads\/2025\/09\/SOFT-_ASIA-42-300x200.png 300w, https:\/\/softasia.jp\/blog\/wp-content\/uploads\/2025\/09\/SOFT-_ASIA-42.png 640w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/p>\n<h3><span id=\"i-8\"><b>\u7f6e\u63db\u7d50\u679c\u3092\u540c\u3058\u5909\u6570\u306b\u4e0a\u66f8\u304d\u3057\u3066\u3044\u3044\u3067\u3059\u304b\uff1f<\/b><\/span><\/h3>\n<p>\u554f\u984c\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n<p>\u4f8b\u3048\u3070\u3001<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #0000ff;\">text = &#8220;I like apples.&#8221;<\/span><\/p>\n<p><span style=\"color: #0000ff;\">text = text.replace(&#8220;apples&#8221;, &#8220;oranges&#8221;)<\/span><\/p>\n<p><span style=\"color: #0000ff;\">print(text)<span class=\"Apple-converted-space\">\u00a0 <\/span># I like oranges.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p>\u306e\u3088\u3046\u306b\u66f8\u3051\u3070\u3001\u5143\u306etext\u5909\u6570\u306e\u5185\u5bb9\u304c\u7f6e\u63db\u5f8c\u306e\u6587\u5b57\u5217\u3067\u4e0a\u66f8\u304d\u3055\u308c\u307e\u3059\u3002\u65b0\u3057\u3044\u5909\u6570\u3092\u4f5c\u308b\u5fc5\u8981\u306f\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n<p>&nbsp;<\/p>\n<h3><span id=\"i-9\"><b>\u5168\u89d2\u30b9\u30da\u30fc\u30b9\u3084\u534a\u89d2\u30b9\u30da\u30fc\u30b9\u3092\u307e\u3068\u3081\u3066\u7f6e\u63db\u3059\u308b\u65b9\u6cd5\u306f\u3042\u308a\u307e\u3059\u304b\uff1f<\/b><\/span><\/h3>\n<p>\u53ef\u80fd\u3067\u3059\u3002\u6587\u5b57\u30b3\u30fc\u30c9\u3092\u610f\u8b58\u3057\u3066\u3001\u7f6e\u63db\u3057\u305f\u3044\u30b9\u30da\u30fc\u30b9\u3054\u3068\u306b\u6307\u5b9a\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #0000ff;\">text = &#8220;\u3053\u3093\u306b\u3061\u306f\u3000\u4e16\u754c&#8221;<span class=\"Apple-converted-space\">\u00a0 <\/span># \u300c\u3053\u3093\u306b\u3061\u306f\u300d\u3068\u300c\u4e16\u754c\u300d\u306e\u9593\u306b\u5168\u89d2\u30b9\u30da\u30fc\u30b9\u3042\u308a<\/span><\/p>\n<p><span style=\"color: #0000ff;\">text = text.replace(&#8220;\u3000&#8221;, &#8221; &#8220;)<span class=\"Apple-converted-space\">\u00a0 <\/span># \u5168\u89d2\u30b9\u30da\u30fc\u30b9\u3092\u534a\u89d2\u30b9\u30da\u30fc\u30b9\u306b\u7f6e\u63db<\/span><\/p>\n<p><span style=\"color: #0000ff;\">print(text)<span class=\"Apple-converted-space\">\u00a0 <\/span># \u3053\u3093\u306b\u3061\u306f \u4e16\u754c<\/span><\/p>\n<p>&nbsp;<\/p>\n<p>\u3053\u306e\u3088\u3046\u306b\u5168\u89d2\u30b9\u30da\u30fc\u30b9\u3068\u534a\u89d2\u30b9\u30da\u30fc\u30b9\u3092\u533a\u5225\u3057\u3066\u7f6e\u63db\u3059\u308b\u306e\u304c\u30b3\u30c4\u3067\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<h3><span id=\"Q3\"><b>Q3. \u4e00\u5ea6\u306b\u8907\u6570\u306e\u6761\u4ef6\u3067\u6587\u5b57\u5217\u3092\u7f6e\u63db\u3059\u308b\u65b9\u6cd5\u306f\uff1f<\/b><\/span><\/h3>\n<p>\u65b9\u6cd5\u306f\u4e3b\u306b2\u3064\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u2460 <b>\u9023\u7d9a\u3057\u3066replace\u3092\u4f7f\u3046<\/b><b><\/b><\/p>\n<p><span style=\"color: #0000ff;\">text = &#8220;red green blue&#8221;<\/span><\/p>\n<p><span style=\"color: #0000ff;\">text = text.replace(&#8220;red&#8221;, &#8220;RED&#8221;).replace(&#8220;green&#8221;, &#8220;GREEN&#8221;)<\/span><\/p>\n<p><span style=\"color: #0000ff;\">print(text)<span class=\"Apple-converted-space\">\u00a0 <\/span># RED GREEN blue<\/span><\/p>\n<p>&nbsp;<\/p>\n<p>\u2461 <b>\u8f9e\u66f8\uff0b\u30eb\u30fc\u30d7\u3067\u4e00\u62ec\u7f6e\u63db\u3059\u308b<\/b><b><\/b><\/p>\n<p><span style=\"color: #0000ff;\">text = &#8220;I like apples and bananas.&#8221;<\/span><\/p>\n<p><span style=\"color: #0000ff;\">replacements = {&#8220;apples&#8221;: &#8220;oranges&#8221;, &#8220;bananas&#8221;: &#8220;grapes&#8221;}<\/span><\/p>\n<p><span style=\"color: #0000ff;\">for old, new in replacements.items():<\/span><\/p>\n<p><span style=\"color: #0000ff;\"><span class=\"Apple-converted-space\">\u00a0 \u00a0 <\/span>text = text.replace(old, new)<\/span><\/p>\n<p><span style=\"color: #0000ff;\">print(text)<span class=\"Apple-converted-space\">\u00a0 <\/span># I like oranges and grapes.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p>\u8907\u6570\u306e\u5358\u8a9e\u3084\u8a18\u53f7\u3092\u4e00\u6c17\u306b\u7f6e\u63db\u3057\u305f\u3044\u3068\u304d\u306b\u306f\u3001\u8f9e\u66f8\u3092\u4f7f\u3046\u65b9\u6cd5\u304c\u3068\u3066\u3082\u4fbf\u5229\u3067\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<h2><span id=\"i-10\"><span style=\"font-weight: 400;\">\u307e\u3068\u3081<\/span><\/span><\/h2>\n<p><span style=\"font-weight: 400;\">Python\u3067\u306e\u6587\u5b57\u5217\u51e6\u7406\u306b\u304a\u3044\u3066\u3001<\/span><span style=\"font-weight: 400;\">replace<\/span><span style=\"font-weight: 400;\">\u30e1\u30bd\u30c3\u30c9\u306f\u307e\u3055\u306b\u57fa\u790e\u4e2d\u306e\u57fa\u790e\u3068\u3044\u3048\u308b\u5b58\u5728\u3067\u3059\u3002<\/span><span style=\"font-weight: 400;\">count<\/span><span style=\"font-weight: 400;\">\u5f15\u6570\u3092\u4f7f\u3048\u3070\u7f6e\u63db\u56de\u6570\u3092\u81ea\u7531\u306b\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u3067\u304d\u3001\u5358\u7d14\u306a\u7f6e\u63db\u306f<\/span><span style=\"font-weight: 400;\">replace<\/span><span style=\"font-weight: 400;\">\u3001\u8907\u96d1\u306a\u30d1\u30bf\u30fc\u30f3\u3092\u6271\u3044\u305f\u3044\u3068\u304d\u306b\u306f<\/span><span style=\"font-weight: 400;\">re.sub<\/span><span style=\"font-weight: 400;\">\u3092\u4f7f\u3044\u5206\u3051\u308b\u3053\u3068\u3067\u3001\u3088\u308a\u67d4\u8edf\u306a\u51e6\u7406\u304c\u53ef\u80fd\u306b\u306a\u308a\u307e\u3059\u3002<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">\u307e\u305f\u3001pandas\u3084\u30ea\u30b9\u30c8\u5185\u5305\u8868\u8a18\u3092\u6d3b\u7528\u3059\u308c\u3070\u3001\u5927\u91cf\u30c7\u30fc\u30bf\u306e\u7f6e\u63db\u4f5c\u696d\u3082\u52b9\u7387\u7684\u306b\u884c\u3048\u307e\u3059\u3002\u30a8\u30e9\u30fc\u51e6\u7406\u3084\u6587\u5b57\u30b3\u30fc\u30c9\u306e\u9055\u3044\u306b\u6c17\u3092\u3064\u3051\u308b\u3053\u3068\u3067\u3001\u5b9f\u52d9\u306b\u304a\u3044\u3066\u3082\u5f37\u529b\u306a\u6b66\u5668\u3068\u306a\u308b\u3067\u3057\u3087\u3046\u3002<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">\u6587\u5b57\u5217\u51e6\u7406\u306fPython\u3092\u5b66\u3076\u3046\u3048\u3067\u6b20\u304b\u305b\u306a\u3044\u30b9\u30ad\u30eb\u3067\u3042\u308a\u3001Web\u958b\u767a\u30fb\u30c7\u30fc\u30bf\u5206\u6790\u30fb\u6a5f\u68b0\u5b66\u7fd2\u306a\u3069\u5e45\u5e83\u3044\u5206\u91ce\u3067\u6d3b\u7528\u3067\u304d\u307e\u3059\u3002\u305c\u3072\u3053\u306e\u8a18\u4e8b\u3092\u53c2\u8003\u306b\u3001<\/span><span style=\"font-weight: 400;\">replace<\/span><span style=\"font-weight: 400;\">\u30e1\u30bd\u30c3\u30c9\u3092\u3057\u3063\u304b\u308a\u8eab\u306b\u3064\u3051\u3066\u304f\u3060\u3055\u3044\u3002<\/span><\/p>\n<p>\u3055\u3089\u306b\u3001\u81ea\u793e\u30b7\u30b9\u30c6\u30e0\u3067\u306e\u30c7\u30fc\u30bf\u51e6\u7406\u52b9\u7387\u5316\u3084\u6587\u5b57\u5217\u64cd\u4f5c\u306e\u81ea\u52d5\u5316\u3092\u3054\u691c\u8a0e\u4e2d\u306e\u65b9\u306f\u3001\u305c\u3072 <a href=\"https:\/\/softasia.jp\/#contact\"><em><strong><span style=\"color: #0000ff;\">3ink<\/span><\/strong><\/em><\/a> \u306b\u3054\u76f8\u8ac7\u304f\u3060\u3055\u3044\u3002\u73fe\u5834\u306b\u5373\u3057\u305f\u6700\u9069\u306a\u30bd\u30ea\u30e5\u30fc\u30b7\u30e7\u30f3\u3092\u3054\u63d0\u6848\u3044\u305f\u3057\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; Python\u3067\u6587\u5b57\u5217\u3092\u51e6\u7406\u3059\u308b\u3068\u304d\u306b\u3001\u6700\u3082\u3088\u304f\u4f7f\u308f\u308c\u308b\u6a5f\u80fd\u306e\u4e00\u3064\u304creplace\u30e1\u30bd\u30c3\u30c9\u3067\u3059\u3002\u300c\u7279\u5b9a\u306e\u6587\u5b57\u3084\u5358\u8a9e\u3092\u307e\u3068\u3081\u3066\u5909\u3048\u305f\u3044\u300d\u300c\u4f59\u8a08\u306a\u8a18\u53f7\u3092\u6d88\u3057\u305f\u3044\u300d\u300c\u7f6e\u63db\u56de\u6570\u3092\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u3057\u305f\u3044\u300d\u3068\u3044\u3063\u305f\u30cb\u30fc\u30ba\u306b\u5fdc [&hellip;]<\/p>\n","protected":false},"author":9,"featured_media":2609,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false},"categories":[4,1,9],"tags":[],"jetpack_featured_media_url":"https:\/\/softasia.jp\/blog\/wp-content\/uploads\/2025\/09\/SOFT_ASIA_\u30a2\u30a4\u30ad\u30e3\u30c3\u30c1-11.png","_links":{"self":[{"href":"https:\/\/softasia.jp\/blog\/wp-json\/wp\/v2\/posts\/2605"}],"collection":[{"href":"https:\/\/softasia.jp\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/softasia.jp\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/softasia.jp\/blog\/wp-json\/wp\/v2\/users\/9"}],"replies":[{"embeddable":true,"href":"https:\/\/softasia.jp\/blog\/wp-json\/wp\/v2\/comments?post=2605"}],"version-history":[{"count":26,"href":"https:\/\/softasia.jp\/blog\/wp-json\/wp\/v2\/posts\/2605\/revisions"}],"predecessor-version":[{"id":2641,"href":"https:\/\/softasia.jp\/blog\/wp-json\/wp\/v2\/posts\/2605\/revisions\/2641"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/softasia.jp\/blog\/wp-json\/wp\/v2\/media\/2609"}],"wp:attachment":[{"href":"https:\/\/softasia.jp\/blog\/wp-json\/wp\/v2\/media?parent=2605"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/softasia.jp\/blog\/wp-json\/wp\/v2\/categories?post=2605"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/softasia.jp\/blog\/wp-json\/wp\/v2\/tags?post=2605"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}