{"id":844,"date":"2024-06-02T14:22:03","date_gmt":"2024-06-02T05:22:03","guid":{"rendered":"https:\/\/chocottopro.com\/?p=844"},"modified":"2024-06-02T14:23:32","modified_gmt":"2024-06-02T05:23:32","slug":"%e3%80%90numpy%e5%85%a5%e9%96%80%e3%80%91%e3%82%8f%e3%81%8b%e3%82%8a%e3%82%84%e3%81%99%e3%81%84%e5%9b%b3%e8%a7%a3%e3%81%a8%e3%82%b3%e3%83%bc%e3%83%89%e4%be%8b%e3%81%a7%e5%be%b9%e5%ba%95%e8%a7%a3","status":"publish","type":"post","link":"https:\/\/chocottopro.com\/?p=844","title":{"rendered":"\u3010numpy\u5165\u9580\u3011\u308f\u304b\u308a\u3084\u3059\u3044\u56f3\u89e3\u3068\u30b3\u30fc\u30c9\u4f8b\u3067\u5fb9\u5e95\u89e3\u8aac\uff01reshape\u306e\u4f7f\u3044\u65b9\u3092\u30de\u30b9\u30bf\u30fc\u3057\u3088\u3046"},"content":{"rendered":"\n<p>Python\u3067\u30c7\u30fc\u30bf\u5206\u6790\u3084\u6a5f\u68b0\u5b66\u7fd2\u3092\u884c\u3046\u4e0a\u3067\u6b20\u304b\u305b\u306a\u3044NumPy\u306ereshape\u30e1\u30bd\u30c3\u30c9\u3002\u914d\u5217\u306e\u5f62\u72b6\u3092\u81ea\u7531\u81ea\u5728\u306b\u5909\u66f4\u3067\u304d\u308b\u3053\u306e\u5f37\u529b\u306a\u6a5f\u80fd\u3092\u3001\u5b9f\u4f8b\u3092\u4ea4\u3048\u3066\u308f\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3057\u307e\u3059\u3002\u57fa\u672c\u7684\u306a\u4f7f\u3044\u65b9\u304b\u3089\u5b9f\u8df5\u7684\u306aTips\u307e\u3067\u3001reshape\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u3044\u3053\u306a\u3059\u305f\u3081\u306e\u30ce\u30a6\u30cf\u30a6\u304c\u6e80\u8f09\u3067\u3059\u3002<\/p>\n\n\n\n<div class=\"wp-block-sgb-block-simple sgb-box-simple sgb-box-simple--title-normal sgb-box-simple--with-border\"><div style=\"background-color:var(--wp--preset--color--sango-main);color:#FFF\" class=\"sgb-box-simple__title\">\u3053\u306e\u8a18\u4e8b\u3092\u8aad\u3093\u3060\u3089\u308f\u304b\u308b\u3053\u3068<\/div><div class=\"sgb-box-simple__body\" style=\"border-color:var(--wp--preset--color--sango-main);background-color:#FFF\">\n<ul class=\"wp-block-list\">\n<li>reshape\u30e1\u30bd\u30c3\u30c9\u306e\u57fa\u672c\u7684\u306a\u4f7f\u3044\u65b9 <\/li>\n\n\n\n<li>\u591a\u6b21\u5143\u914d\u5217\u30681\u6b21\u5143\u914d\u5217\u306e\u76f8\u4e92\u5909\u63db <\/li>\n\n\n\n<li>\u6642\u7cfb\u5217\u30c7\u30fc\u30bf\u3084\u753b\u50cf\u30c7\u30fc\u30bf\u306e\u524d\u51e6\u7406\u3078\u306e\u5fdc\u7528 <\/li>\n\n\n\n<li>-1\u3092\u4f7f\u3063\u305f\u81ea\u52d5\u30b5\u30a4\u30ba\u8abf\u6574 <\/li>\n\n\n\n<li>order\u5f15\u6570\u306b\u3088\u308b\u8981\u7d20\u306e\u4e26\u3073\u66ff\u3048 <\/li>\n\n\n\n<li>\u30e1\u30e2\u30ea\u4f7f\u7528\u91cf\u306b\u914d\u616e\u3057\u305freshape\u306e\u4f7f\u3044\u65b9<\/li>\n<\/ul>\n<\/div><\/div>\n\n\n\n<div class=\"toc\"><br \/>\n<b>Warning<\/b>:  Undefined array key \"is_admin\" in <b>\/home\/c7479301\/public_html\/chocottopro.com\/wp-content\/themes\/sango-theme\/library\/gutenberg\/dist\/classes\/Toc.php<\/b> on line <b>116<\/b><br \/>\n<br \/>\n<b>Warning<\/b>:  Undefined array key \"is_category_top\" in <b>\/home\/c7479301\/public_html\/chocottopro.com\/wp-content\/themes\/sango-theme\/library\/gutenberg\/dist\/classes\/Toc.php<\/b> on line <b>121<\/b><br \/>\n<br \/>\n<b>Warning<\/b>:  Undefined array key \"is_top\" in <b>\/home\/c7479301\/public_html\/chocottopro.com\/wp-content\/themes\/sango-theme\/library\/gutenberg\/dist\/classes\/Toc.php<\/b> on line <b>128<\/b><br \/>\n    <div id=\"toc_container\" class=\"sgb-toc--bullets js-smooth-scroll\" data-dialog-title=\"Table of Contents\">\n      <p class=\"toc_title\">\u76ee\u6b21 <\/p>\n      <ul class=\"toc_list\">  <li class=\"first\">    <a href=\"#i-0\">numpy\u306ereshape\u3068\u306f\uff1f\u914d\u5217\u306e\u5f62\u72b6\u3092\u81ea\u5728\u306b\u5909\u66f4\u3067\u304d\u308b\u5f37\u529b\u306a\u30e1\u30bd\u30c3\u30c9<\/a>  <\/li>  <li>    <a href=\"#i-1\">reshape\u306e\u57fa\u672c\u7684\u306a\u4f7f\u3044\u65b9\u3092\u30de\u30b9\u30bf\u30fc\u3057\u3088\u3046<\/a>    <ul class=\"menu_level_1\">      <li class=\"first\">        <a href=\"#i-2\">reshape\u306e\u30b7\u30f3\u30bf\u30c3\u30af\u30b9\u3068\u5f15\u6570\u306e\u610f\u5473\u3092\u7406\u89e3\u3059\u308b<\/a>      <\/li>      <li>        <a href=\"#i-3\">\u8981\u7d20\u6570\u304c\u4e00\u81f4\u3057\u306a\u3044\u5834\u5408\u306ereshape\u306e\u52d5\u4f5c\u306b\u6ce8\u610f<\/a>      <\/li>      <li class=\"last\">        <a href=\"#i-4\">\u5177\u4f53\u7684\u306a\u30b3\u30fc\u30c9\u4f8b\u3067\u4f7f\u3044\u65b9\u3092\u78ba\u8a8d\u3057\u3088\u3046<\/a>      <\/li>    <\/ul>  <\/li>  <li>    <a href=\"#i-5\">\u3055\u307e\u3056\u307e\u306a\u30b1\u30fc\u30b9\u306b\u5bfe\u5fdc\uff01reshape\u306e\u4f7f\u7528\u4f8b<\/a>    <ul class=\"menu_level_1\">      <li class=\"first\">        <a href=\"#i-6\">1\u6b21\u5143\u914d\u5217\u30922\u6b21\u5143\u914d\u5217\u306b\u5909\u63db\u3059\u308b\u4f8b<\/a>      <\/li>      <li>        <a href=\"#i-7\">\u591a\u6b21\u5143\u914d\u5217\u30921\u6b21\u5143\u914d\u5217\u306b\u5e73\u5766\u5316\u3059\u308b\u4f8b<\/a>      <\/li>      <li class=\"last\">        <a href=\"#i-8\">\u8ee2\u7f6e\u3092\u6d3b\u7528\u3057\u3066\u914d\u5217\u306e\u8ef8\u3092\u5165\u308c\u66ff\u3048\u308b\u4f8b<\/a>      <\/li>    <\/ul>  <\/li>  <li>    <a href=\"#i-9\">reshape\u3092\u4f7f\u3044\u3053\u306a\u3059\u305f\u3081\u306eTips<\/a>    <ul class=\"menu_level_1\">      <li class=\"first\">        <a href=\"#i-10\">-1\u3092\u4f7f\u3063\u3066\u81ea\u52d5\u7684\u306b\u30b5\u30a4\u30ba\u3092\u8abf\u6574\u3059\u308b<\/a>      <\/li>      <li>        <a href=\"#i-11\">order\u5f15\u6570\u3067\u8981\u7d20\u306e\u4e26\u3073\u9806\u3092\u6307\u5b9a\u3059\u308b<\/a>      <\/li>      <li class=\"last\">        <a href=\"#i-12\">\u30e1\u30e2\u30ea\u4f7f\u7528\u91cf\u306b\u6ce8\u610f\u3057\u306a\u304c\u3089\u5f62\u72b6\u3092\u5909\u66f4\u3059\u308b<\/a>      <\/li>    <\/ul>  <\/li>  <li class=\"last\">    <a href=\"#i-13\">\u30c7\u30fc\u30bf\u5206\u6790\u3084\u6a5f\u68b0\u5b66\u7fd2\u3067reshape\u3092\u6d3b\u7528\u3057\u3088\u3046<\/a>    <ul class=\"menu_level_1\">      <li class=\"first\">        <a href=\"#i-14\">\u753b\u50cf\u30c7\u30fc\u30bf\u306e\u524d\u51e6\u7406\u3067reshape\u304c\u5927\u6d3b\u8e8d<\/a>      <\/li>      <li>        <a href=\"#i-15\">\u6642\u7cfb\u5217\u30c7\u30fc\u30bf\u3092\u6271\u3046\u969b\u306breshape\u304c\u4fbf\u5229<\/a>      <\/li>      <li class=\"last\">        <a href=\"#i-16\">\u30e2\u30c7\u30eb\u306e\u5165\u51fa\u529b\u3068\u30c7\u30fc\u30bf\u5f62\u72b6\u3092\u4e00\u81f4\u3055\u305b\u308b\u305f\u3081\u306breshape\u3092\u4f7f\u3046<\/a>      <\/li>    <\/ul>  <\/li><\/ul>\n      \n    <\/div><\/div><h2 class=\"wp-block-heading\" id=\"i-0\">numpy\u306ereshape\u3068\u306f\uff1f\u914d\u5217\u306e\u5f62\u72b6\u3092\u81ea\u5728\u306b\u5909\u66f4\u3067\u304d\u308b\u5f37\u529b\u306a\u30e1\u30bd\u30c3\u30c9<\/h2>\n\n\n\n<p>Numpy\u306f\u3001Python\u3067\u30c7\u30fc\u30bf\u5206\u6790\u3084\u6a5f\u68b0\u5b66\u7fd2\u3092\u884c\u3046\u4e0a\u3067\u6b20\u304b\u305b\u306a\u3044\u30e9\u30a4\u30d6\u30e9\u30ea\u3067\u3059\u3002\u305d\u306e\u4e2d\u3067\u3082\u3001reshape\u30e1\u30bd\u30c3\u30c9\u306f\u7279\u306b\u91cd\u8981\u306a\u6a5f\u80fd\u306e\u4e00\u3064\u3068\u8a00\u3048\u308b\u3067\u3057\u3087\u3046\u3002reshape\u3092\u4f7f\u3048\u3070\u3001NumPy\u914d\u5217(ndarray)\u306e\u5f62\u72b6\u3092\u81ea\u7531\u81ea\u5728\u306b\u5909\u66f4\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u5177\u4f53\u7684\u306b\u306f\u3001reshape\u30e1\u30bd\u30c3\u30c9\u306f\u914d\u5217\u306e\u6b21\u5143\u6570\u3084\u5404\u6b21\u5143\u306e\u30b5\u30a4\u30ba\u3092\u5909\u66f4\u3059\u308b\u50cd\u304d\u3092\u6301\u3063\u3066\u3044\u307e\u3059\u3002\u3057\u304b\u3082\u3001\u914d\u5217\u306e\u8981\u7d20\u6570\u306f\u5909\u3048\u305a\u306b\u5f62\u72b6\u306e\u5909\u66f4\u304c\u53ef\u80fd\u3002\u3064\u307e\u308a\u3001\u30c7\u30fc\u30bf\u306e\u5024\u3092\u7dad\u6301\u3057\u305f\u307e\u307e\u3001\u5fc5\u8981\u306a\u5f62\u5f0f\u306b\u914d\u5217\u3092\u5909\u5f62\u3055\u305b\u3089\u308c\u308b\u306e\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u4f7f\u3044\u65b9\u306f\u3068\u3066\u3082\u30b7\u30f3\u30d7\u30eb\u3067\u3059\u3002reshape\u30e1\u30bd\u30c3\u30c9\u306b\u3001\u76ee\u7684\u306e\u5f62\u72b6\u3092\u30bf\u30d7\u30eb\u3067\u6307\u5b9a\u3059\u308b\u3060\u3051\u3002\u4f8b\u3048\u3070\u30011\u6b21\u5143\u914d\u5217\u30922\u6b21\u5143\u914d\u5217\u306b\u5909\u63db\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">import numpy as np\n\n# 1\u6b21\u5143\u914d\u5217\u3092\u4f5c\u6210\narr1 = np.array([1, 2, 3, 4, 5, 6])\n\n# \u914d\u5217\u306e\u5f62\u72b6\u3092\u78ba\u8a8d\nprint(arr1.shape)  # (6,)\n\n# reshape\u3067\u5f62\u72b6\u3092\u5909\u66f4\narr2 = arr1.reshape((2, 3))\n\n# \u5909\u66f4\u5f8c\u306e\u5f62\u72b6\u3092\u78ba\u8a8d\nprint(arr2.shape)  # (2, 3)\nprint(arr2)\n# [[1 2 3]\n#  [4 5 6]]<\/pre>\n\n\n\n<p>\u3053\u306e\u3088\u3046\u306breshape\u3092\u547c\u3073\u51fa\u3059\u3060\u3051\u3067\u30011\u6b21\u5143\u914d\u5217\u304b\u30892\u6b21\u5143\u914d\u5217\u3078\u3068\u7c21\u5358\u306b\u5909\u63db\u3067\u304d\u307e\u3057\u305f\u3002\u9006\u306b\u3001\u591a\u6b21\u5143\u914d\u5217\u30921\u6b21\u5143\u914d\u5217\u306b\u5909\u63db\u3057\u305f\u3044\u3068\u304d\u3082\u3001reshape\u30e1\u30bd\u30c3\u30c9\u304c\u5927\u6d3b\u8e8d\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"># 2\u6b21\u5143\u914d\u5217\u3092\u4f5c\u6210\narr3 = np.array([[1, 2, 3], [4, 5, 6]])\n\n# \u914d\u5217\u306e\u5f62\u72b6\u3092\u78ba\u8a8d\nprint(arr3.shape)  # (2, 3)\n\n# reshape\u3067\u5f62\u72b6\u3092\u5909\u66f4\narr4 = arr3.reshape(6)\n\n# \u5909\u66f4\u5f8c\u306e\u5f62\u72b6\u3092\u78ba\u8a8d  \nprint(arr4.shape)  # (6,)\nprint(arr4)  # [1 2 3 4 5 6]<\/pre>\n\n\n\n<p>\u3053\u306e\u3088\u3046\u306b\u3001reshape\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u3044\u3053\u306a\u305b\u3070\u3001\u914d\u5217\u306e\u30c7\u30a3\u30e1\u30f3\u30b8\u30e7\u30f3\uff08\u6b21\u5143\u6570\uff09\u3092\u5897\u3084\u3057\u305f\u308a\u6e1b\u3089\u3057\u305f\u308a\u3068\u3044\u3063\u305f\u64cd\u4f5c\u304c\u601d\u3044\u306e\u307e\u307e\u3002\u8ee2\u7f6e\u3084\u8ef8\u306e\u5165\u308c\u66ff\u3048\u306a\u3069\u3001\u3088\u308a\u8907\u96d1\u306a\u914d\u5217\u64cd\u4f5c\u3082\u53ef\u80fd\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u5b9f\u969b\u306e\u30c7\u30fc\u30bf\u5206\u6790\u3084\u6a5f\u68b0\u5b66\u7fd2\u306e\u73fe\u5834\u3067\u306f\u3001\u30c7\u30fc\u30bf\u306e\u524d\u51e6\u7406\u3084\u7279\u5fb4\u91cf\u30a8\u30f3\u30b8\u30cb\u30a2\u30ea\u30f3\u30b0\u306e\u6bb5\u968e\u3067\u3001\u914d\u5217\u306e\u5f62\u72b6\u3092\u9069\u5207\u306b\u5909\u66f4\u3059\u308b\u5fc5\u8981\u304c\u51fa\u3066\u304d\u307e\u3059\u3002\u305d\u3093\u306a\u3068\u304d\u3053\u305d\u3001reshape\u306e\u51fa\u756a\u3067\u3059\u3002\u305c\u3072\u3001reshape\u30e1\u30bd\u30c3\u30c9\u3092\u81ea\u5728\u306b\u4f7f\u3044\u3053\u306a\u305b\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u3001NumPy\u3067\u306e\u30c7\u30fc\u30bf\u51e6\u7406\u3092\u3088\u308a\u30b9\u30e0\u30fc\u30ba\u306b\u9032\u3081\u3089\u308c\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u3087\u3046\uff01<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-1\">reshape\u306e\u57fa\u672c\u7684\u306a\u4f7f\u3044\u65b9\u3092\u30de\u30b9\u30bf\u30fc\u3057\u3088\u3046<\/h2>\n\n\n\n<p>reshape\u30e1\u30bd\u30c3\u30c9\u3092\u52b9\u679c\u7684\u306b\u4f7f\u7528\u3059\u308b\u306b\u306f\u3001\u305d\u306e\u57fa\u672c\u7684\u306a\u4f7f\u3044\u65b9\u3092\u7406\u89e3\u3059\u308b\u3053\u3068\u304c\u5927\u5207\u3067\u3059\u3002\u307e\u305a\u306f\u3001reshape\u30e1\u30bd\u30c3\u30c9\u306e\u30b7\u30f3\u30bf\u30c3\u30af\u30b9\u3092\u898b\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-2\">reshape\u306e\u30b7\u30f3\u30bf\u30c3\u30af\u30b9\u3068\u5f15\u6570\u306e\u610f\u5473\u3092\u7406\u89e3\u3059\u308b<\/h3>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">numpy.reshape(a, newshape)<\/pre>\n\n\n\n<p>reshape\u30e1\u30bd\u30c3\u30c9\u306f\u3001\u4e0a\u8a18\u306e\u3088\u3046\u306a\u30b7\u30f3\u30bf\u30c3\u30af\u30b9\u3067\u4f7f\u7528\u3057\u307e\u3059\u3002\u7b2c1\u5f15\u6570\u306e<code>a<\/code>\u306f\u3001\u5f62\u72b6\u3092\u5909\u66f4\u3059\u308b\u914d\u5217\u3067\u3059\u3002\u7b2c2\u5f15\u6570\u306e<code>newshape<\/code>\u306f\u3001\u5909\u66f4\u5f8c\u306e\u5f62\u72b6\u3092\u30bf\u30d7\u30eb\u3067\u6307\u5b9a\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>reshape\u30e1\u30bd\u30c3\u30c9\u3092\u547c\u3073\u51fa\u3059\u3068\u3001\u5f62\u72b6\u3092\u5909\u66f4\u3057\u305f\u65b0\u3057\u3044\u914d\u5217\u304c\u8fd4\u3055\u308c\u307e\u3059\u3002\u305f\u3060\u3057\u3001\u5143\u306e\u914d\u5217\u306f\u305d\u306e\u307e\u307e\u4fdd\u6301\u3055\u308c\u3066\u3044\u308b\u306e\u3067\u6ce8\u610f\u304c\u5fc5\u8981\u3067\u3059\u306d\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-3\">\u8981\u7d20\u6570\u304c\u4e00\u81f4\u3057\u306a\u3044\u5834\u5408\u306ereshape\u306e\u52d5\u4f5c\u306b\u6ce8\u610f<\/h3>\n\n\n\n<p>reshape\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u7528\u3059\u308b\u969b\u306f\u3001\u5909\u66f4\u524d\u3068\u5909\u66f4\u5f8c\u306e\u914d\u5217\u306e\u8981\u7d20\u6570\u304c\u4e00\u81f4\u3057\u3066\u3044\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u8981\u7d20\u6570\u304c\u5408\u308f\u306a\u3044\u5834\u5408\u306f\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">import numpy as np\n\narr1 = np.array([[1, 2, 3], [4, 5, 6]])\n\n# \u8981\u7d20\u6570\u304c\u4e00\u81f4\u3057\u306a\u3044\u5834\u5408\u306f\u30a8\u30e9\u30fc\narr2 = arr1.reshape((2, 4))  # ValueError: cannot reshape array of size 6 into shape (2,4)<\/pre>\n\n\n\n<p>\u3053\u306e\u30a8\u30e9\u30fc\u3092\u907f\u3051\u308b\u305f\u3081\u306b\u306f\u3001\u914d\u5217\u306e\u30b5\u30a4\u30ba\u3092\u78ba\u8a8d\u3057\u306a\u304c\u3089\u3001\u9069\u5207\u306a\u5f62\u72b6\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u304c\u5927\u5207\u3067\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-4\">\u5177\u4f53\u7684\u306a\u30b3\u30fc\u30c9\u4f8b\u3067\u4f7f\u3044\u65b9\u3092\u78ba\u8a8d\u3057\u3088\u3046<\/h3>\n\n\n\n<p>\u305d\u308c\u3067\u306f\u3001\u5177\u4f53\u7684\u306a\u30b3\u30fc\u30c9\u4f8b\u3092\u898b\u306a\u304c\u3089\u3001reshape\u30e1\u30bd\u30c3\u30c9\u306e\u4f7f\u3044\u65b9\u3092\u78ba\u8a8d\u3057\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">import numpy as np\n\n# 1\u6b21\u5143\u914d\u5217\u3092\u4f5c\u6210\narr1 = np.array([1, 2, 3, 4, 5, 6])\n\n# 2x3\u306e2\u6b21\u5143\u914d\u5217\u306b\u5909\u66f4\narr2 = arr1.reshape((2, 3))\nprint(arr2)\n# [[1 2 3]\n#  [4 5 6]]\n\n# 3x2\u306e2\u6b21\u5143\u914d\u5217\u306b\u5909\u66f4\narr3 = arr1.reshape((3, 2))\nprint(arr3)\n# [[1 2]\n#  [3 4]\n#  [5 6]]\n\n# 2\u6b21\u5143\u914d\u5217\u30921\u6b21\u5143\u914d\u5217\u306b\u5909\u66f4\narr4 = arr2.reshape(6)\nprint(arr4)\n# [1 2 3 4 5 6]<\/pre>\n\n\n\n<p>\u4e0a\u8a18\u306e\u4f8b\u3067\u306f\u30011\u6b21\u5143\u914d\u5217\u30922\u6b21\u5143\u914d\u5217\u306b\u5909\u63db\u3057\u305f\u308a\u30012\u6b21\u5143\u914d\u5217\u30921\u6b21\u5143\u914d\u5217\u306b\u5909\u63db\u3057\u305f\u308a\u3057\u3066\u3044\u307e\u3059\u3002reshape\u30e1\u30bd\u30c3\u30c9\u306b\u76ee\u7684\u306e\u5f62\u72b6\u3092\u6307\u5b9a\u3059\u308b\u3060\u3051\u3067\u3001\u7c21\u5358\u306b\u914d\u5217\u306e\u5f62\u72b6\u3092\u5909\u66f4\u3067\u304d\u308b\u3053\u3068\u304c\u308f\u304b\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u307e\u305f\u3001reshape\u30e1\u30bd\u30c3\u30c9\u306b\u306f<code>-1<\/code>\u3092\u6307\u5b9a\u3059\u308b\u4fbf\u5229\u306a\u4f7f\u3044\u65b9\u3082\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"># -1\u3092\u4f7f\u3063\u305f\u81ea\u52d5\u30b5\u30a4\u30ba\u8abf\u6574\narr5 = arr1.reshape((2, -1))\nprint(arr5)\n# [[1 2 3]\n#  [4 5 6]]<\/pre>\n\n\n\n<p><code>-1<\/code>\u3092\u4f7f\u3046\u3068\u3001\u4ed6\u306e\u6b21\u5143\u304b\u3089\u8981\u7d20\u6570\u3092\u63a8\u6e2c\u3057\u3066\u81ea\u52d5\u7684\u306b\u30b5\u30a4\u30ba\u3092\u6c7a\u5b9a\u3057\u3066\u304f\u308c\u307e\u3059\u3002\u305f\u3060\u3057\u3001<code>-1<\/code>\u306f\u6700\u59271\u3064\u307e\u3067\u3057\u304b\u6307\u5b9a\u3067\u304d\u306a\u3044\u306e\u3067\u6ce8\u610f\u304c\u5fc5\u8981\u3067\u3059\u306d\u3002<\/p>\n\n\n\n<p>\u3053\u306e\u3088\u3046\u306b\u3001reshape\u30e1\u30bd\u30c3\u30c9\u306e\u57fa\u672c\u7684\u306a\u4f7f\u3044\u65b9\u3092\u8eab\u306b\u3064\u3051\u308c\u3070\u3001\u914d\u5217\u306e\u5f62\u72b6\u3092\u81ea\u7531\u81ea\u5728\u306b\u5909\u66f4\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002\u6b21\u306f\u3001\u5b9f\u969b\u306e\u30c7\u30fc\u30bf\u5206\u6790\u3084\u6a5f\u68b0\u5b66\u7fd2\u3067reshape\u30e1\u30bd\u30c3\u30c9\u3092\u6d3b\u7528\u3057\u3066\u3044\u304f\u305f\u3081\u306e\u30b3\u30c4\u3092\u898b\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-5\">\u3055\u307e\u3056\u307e\u306a\u30b1\u30fc\u30b9\u306b\u5bfe\u5fdc\uff01reshape\u306e\u4f7f\u7528\u4f8b<\/h2>\n\n\n\n<p>reshape\u30e1\u30bd\u30c3\u30c9\u306f\u3001\u914d\u5217\u306e\u5f62\u72b6\u3092\u5909\u66f4\u3059\u308b\u305f\u3081\u306e\u57fa\u672c\u7684\u306a\u6a5f\u80fd\u3067\u3059\u304c\u3001\u5b9f\u969b\u306e\u30c7\u30fc\u30bf\u5206\u6790\u3084\u6a5f\u68b0\u5b66\u7fd2\u306e\u30bf\u30b9\u30af\u3067\u306f\u3001\u3055\u307e\u3056\u307e\u306a\u5834\u9762\u3067\u5fdc\u7528\u7684\u306b\u4f7f\u7528\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u3053\u3053\u3067\u306f\u3001reshape\u306e\u5b9f\u8df5\u7684\u306a\u6d3b\u7528\u4f8b\u3092\u3044\u304f\u3064\u304b\u7d39\u4ecb\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-6\">1\u6b21\u5143\u914d\u5217\u30922\u6b21\u5143\u914d\u5217\u306b\u5909\u63db\u3059\u308b\u4f8b<\/h3>\n\n\n\n<p>\u6642\u7cfb\u5217\u30c7\u30fc\u30bf\u3092\u6271\u3046\u969b\u306b\u306f\u3001\u3057\u3070\u3057\u30701\u6b21\u5143\u914d\u5217\u3067\u683c\u7d0d\u3055\u308c\u305f\u30c7\u30fc\u30bf\u3092\u3001\u6642\u9593\u30b9\u30c6\u30c3\u30d7\u3068\u7279\u5fb4\u91cf\u304b\u3089\u306a\u308b2\u6b21\u5143\u914d\u5217\u306b\u5909\u63db\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002reshape\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u3048\u3070\u3001\u3053\u306e\u3088\u3046\u306a\u5909\u63db\u3092\u7c21\u5358\u306b\u884c\u3048\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">import numpy as np\n\n# \u6642\u7cfb\u5217\u30c7\u30fc\u30bf\u3092\u683c\u7d0d\u3057\u305f1\u6b21\u5143\u914d\u5217\ntime_series_data = np.array([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12])\n\n# \u6642\u9593\u30b9\u30c6\u30c3\u30d7\u00d7\u7279\u5fb4\u91cf\u306e2\u6b21\u5143\u914d\u5217\u306b\u5909\u63db\nreshaped_data = time_series_data.reshape((4, 3))\nprint(reshaped_data)\n# [[ 1  2  3]\n#  [ 4  5  6]\n#  [ 7  8  9]\n#  [10 11 12]]<\/pre>\n\n\n\n<p>\u4e0a\u8a18\u306e\u4f8b\u3067\u306f\u300112\u500b\u306e\u8981\u7d20\u3092\u6301\u30641\u6b21\u5143\u914d\u5217\u3092\u30014\u3064\u306e\u6642\u9593\u30b9\u30c6\u30c3\u30d7\u30683\u3064\u306e\u7279\u5fb4\u91cf\u304b\u3089\u306a\u308b2\u6b21\u5143\u914d\u5217\u306b\u5909\u63db\u3057\u3066\u3044\u307e\u3059\u3002\u3053\u306e\u3088\u3046\u306b\u3001reshape\u3092\u4f7f\u3048\u3070\u3001\u6642\u7cfb\u5217\u30c7\u30fc\u30bf\u306e\u5f62\u72b6\u3092\u9069\u5207\u306b\u5909\u66f4\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u540c\u69d8\u306b\u3001\u753b\u50cf\u30c7\u30fc\u30bf\u3092\u6271\u3046\u969b\u306b\u3082\u30011\u6b21\u5143\u306e\u30d9\u30af\u30c8\u30eb\u304b\u3089\u3001\u9ad8\u3055\u30fb\u5e45\u30fb\u30c1\u30e3\u30f3\u30cd\u30eb\u6570\u3067\u8868\u73fe\u3055\u308c\u305f2\u6b21\u5143\u914d\u5217\u306b\u5909\u63db\u3059\u308b\u30b1\u30fc\u30b9\u304c\u3042\u308a\u307e\u3059\u3002reshape\u30e1\u30bd\u30c3\u30c9\u3092\u6d3b\u7528\u3059\u308c\u3070\u3001\u3053\u306e\u3088\u3046\u306a\u5909\u63db\u3082\u7c21\u6f54\u306b\u8a18\u8ff0\u3067\u304d\u308b\u3067\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-7\">\u591a\u6b21\u5143\u914d\u5217\u30921\u6b21\u5143\u914d\u5217\u306b\u5e73\u5766\u5316\u3059\u308b\u4f8b<\/h3>\n\n\n\n<p>\u9006\u306b\u3001\u591a\u6b21\u5143\u914d\u5217\u30921\u6b21\u5143\u914d\u5217\u306b\u5e73\u5766\u5316\uff08flatten\uff09\u3059\u308b\u5834\u9762\u3082\u5c11\u306a\u304f\u3042\u308a\u307e\u305b\u3093\u3002\u4f8b\u3048\u3070\u3001\u6a5f\u68b0\u5b66\u7fd2\u30e2\u30c7\u30eb\u306b\u5165\u529b\u3059\u308b\u305f\u3081\u306b\u3001\u8907\u6570\u306e\u7279\u5fb4\u91cf\u30921\u3064\u306e\u30d9\u30af\u30c8\u30eb\u306b\u7d50\u5408\u3059\u308b\u969b\u306a\u3069\u3067\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"># 2\u6b21\u5143\u914d\u5217\nmatrix_data = np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]])\n\n# 1\u6b21\u5143\u914d\u5217\u306b\u5e73\u5766\u5316\nflattened_data = matrix_data.reshape(9)\nprint(flattened_data)  # [1 2 3 4 5 6 7 8 9]<\/pre>\n\n\n\n<p>\u3053\u3053\u3067\u306f\u30013\u00d73\u306e2\u6b21\u5143\u914d\u5217\u3092\u30019\u500b\u306e\u8981\u7d20\u3092\u6301\u30641\u6b21\u5143\u914d\u5217\u306b\u5909\u63db\u3057\u3066\u3044\u307e\u3059\u3002reshape\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u3048\u3070\u3001\u3053\u306e\u3088\u3046\u306a\u5e73\u5766\u5316\u3082\u4e00\u884c\u3067\u5b9f\u73fe\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-8\">\u8ee2\u7f6e\u3092\u6d3b\u7528\u3057\u3066\u914d\u5217\u306e\u8ef8\u3092\u5165\u308c\u66ff\u3048\u308b\u4f8b<\/h3>\n\n\n\n<p>reshape\u30e1\u30bd\u30c3\u30c9\u3068\u8ee2\u7f6e\u3092\u7d44\u307f\u5408\u308f\u305b\u308b\u3053\u3068\u3067\u3001\u914d\u5217\u306e\u8ef8\u3092\u5165\u308c\u66ff\u3048\u308b\u3088\u3046\u306a\u30b1\u30fc\u30b9\u306b\u3082\u5bfe\u5fdc\u3067\u304d\u307e\u3059\u3002\u4f8b\u3048\u3070\u3001\u884c\u5217\u306e\u8ee2\u7f6e\u3092\u884c\u3063\u305f\u308a\u3001\u8ef8\u306e\u9806\u5e8f\u3092\u5909\u66f4\u3057\u3066\u30c7\u30fc\u30bf\u3092\u7570\u306a\u308b\u89b3\u70b9\u304b\u3089\u89e3\u6790\u3057\u305f\u308a\u3059\u308b\u969b\u306b\u4fbf\u5229\u3067\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"># 2\u6b21\u5143\u914d\u5217\nmatrix_data = np.array([[1, 2, 3], [4, 5, 6]])\n\n# \u8ee2\u7f6e\u3092\u4f7f\u3063\u3066\u884c\u3068\u5217\u3092\u5165\u308c\u66ff\u3048\u308b\ntransposed_data = matrix_data.reshape((3, 2)).T\nprint(transposed_data)\n# [[1 4]\n#  [2 5]\n#  [3 6]]<\/pre>\n\n\n\n<p>\u3053\u306e\u4f8b\u3067\u306f\u30012\u00d73\u306e\u914d\u5217\u3092 reshape \u30673\u00d72\u306e\u914d\u5217\u306b\u5909\u63db\u3057\u305f\u5f8c\u3001\u8ee2\u7f6e\uff08.T\uff09\u3092\u4f7f\u3063\u3066\u884c\u3068\u5217\u3092\u5165\u308c\u66ff\u3048\u3066\u3044\u307e\u3059\u3002\u3053\u306e\u3088\u3046\u306breshape\u3068\u8ee2\u7f6e\u3092\u7d44\u307f\u5408\u308f\u305b\u308c\u3070\u3001\u914d\u5217\u306e\u8ef8\u3092\u81ea\u7531\u306b\u64cd\u4f5c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u3044\u304b\u304c\u3067\u3057\u3087\u3046\u304b\u3002reshape\u30e1\u30bd\u30c3\u30c9\u306f\u3001\u5b9f\u969b\u306e\u30c7\u30fc\u30bf\u5206\u6790\u3084\u6a5f\u68b0\u5b66\u7fd2\u306e\u30bf\u30b9\u30af\u306b\u304a\u3044\u3066\u3001\u5b9f\u306b\u591a\u69d8\u306a\u5834\u9762\u3067\u6d3b\u7528\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u914d\u5217\u306e\u5f62\u72b6\u3092\u9069\u5207\u306b\u5909\u66f4\u3059\u308b\u3053\u3068\u306f\u3001\u30c7\u30fc\u30bf\u306e\u524d\u51e6\u7406\u3084\u7279\u5fb4\u91cf\u30a8\u30f3\u30b8\u30cb\u30a2\u30ea\u30f3\u30b0\u306e\u91cd\u8981\u306a\u30b9\u30c6\u30c3\u30d7\u3067\u3059\u3002\u305c\u3072\u3001reshape\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u3044\u3053\u306a\u3057\u3066\u3001\u30c7\u30fc\u30bf\u51e6\u7406\u306e\u30b9\u30ad\u30eb\u3092\u78e8\u3044\u3066\u3044\u304d\u307e\u3057\u3087\u3046\uff01<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-9\">reshape\u3092\u4f7f\u3044\u3053\u306a\u3059\u305f\u3081\u306eTips<\/h2>\n\n\n\n<p>\u3053\u3053\u307e\u3067\u3001reshape\u30e1\u30bd\u30c3\u30c9\u306e\u57fa\u672c\u7684\u306a\u4f7f\u3044\u65b9\u3084\u5b9f\u8df5\u7684\u306a\u6d3b\u7528\u4f8b\u3092\u898b\u3066\u304d\u307e\u3057\u305f\u304c\u3001\u3055\u3089\u306b\u52b9\u7387\u7684\u306breshape\u3092\u4f7f\u3044\u3053\u306a\u3059\u305f\u3081\u306b\u77e5\u3063\u3066\u304a\u304f\u3068\u4fbf\u5229\u306a\u30c6\u30af\u30cb\u30c3\u30af\u304c\u3042\u308a\u307e\u3059\u3002\u3053\u3053\u3067\u306f\u3001\u305d\u3093\u306areshape\u306e\u5fdc\u7528\u7684\u306aTips\u30923\u3064\u7d39\u4ecb\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-10\">-1\u3092\u4f7f\u3063\u3066\u81ea\u52d5\u7684\u306b\u30b5\u30a4\u30ba\u3092\u8abf\u6574\u3059\u308b<\/h3>\n\n\n\n<p>reshape\u30e1\u30bd\u30c3\u30c9\u3092\u547c\u3073\u51fa\u3059\u969b\u3001\u5f15\u6570\u306b-1\u3092\u6307\u5b9a\u3059\u308b\u3068\u3001\u4ed6\u306e\u6b21\u5143\u304b\u3089\u8981\u7d20\u6570\u3092\u81ea\u52d5\u7684\u306b\u63a8\u6e2c\u3057\u3066\u304f\u308c\u308b\u4fbf\u5229\u306a\u6a5f\u80fd\u304c\u3042\u308a\u307e\u3059\u3002\u3053\u308c\u3092\u6d3b\u7528\u3059\u308c\u3070\u3001\u660e\u793a\u7684\u306b\u30b5\u30a4\u30ba\u3092\u6307\u5b9a\u3059\u308b\u5fc5\u8981\u304c\u306a\u304f\u306a\u308a\u3001\u30b3\u30fc\u30c9\u304c\u3059\u3063\u304d\u308a\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">import numpy as np\n\n# 2\u6b21\u5143\u914d\u5217\nmatrix_data = np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]])\n\n# -1\u3092\u4f7f\u3063\u3066\u81ea\u52d5\u7684\u306b\u30b5\u30a4\u30ba\u3092\u8abf\u6574\nreshaped_data = matrix_data.reshape((-1, 3))\nprint(reshaped_data)\n# [[1 2 3]\n#  [4 5 6]\n#  [7 8 9]]<\/pre>\n\n\n\n<p>\u4e0a\u8a18\u306e\u4f8b\u3067\u306f\u3001reshape((-1, 3))\u3068\u6307\u5b9a\u3059\u308b\u3053\u3068\u3067\u3001\u5217\u306e\u30b5\u30a4\u30ba\u30923\u306b\u56fa\u5b9a\u3057\u3001\u884c\u306e\u30b5\u30a4\u30ba\u3092\u81ea\u52d5\u7684\u306b\u8abf\u6574\u3057\u3066\u3044\u307e\u3059\u3002\u3053\u306e\u3088\u3046\u306b\u3001-1\u3092\u4f7f\u3048\u3070\u3001\u914d\u5217\u306e\u8981\u7d20\u6570\u304b\u3089\u9069\u5207\u306a\u5f62\u72b6\u3092\u63a8\u6e2c\u3067\u304d\u308b\u305f\u3081\u3001\u30b3\u30fc\u30c9\u306e\u53ef\u8aad\u6027\u304c\u5411\u4e0a\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u305f\u3060\u3057\u3001-1\u306f\u6700\u5927\u3067\u30821\u3064\u306e\u6b21\u5143\u306b\u3057\u304b\u6307\u5b9a\u3067\u304d\u306a\u3044\u306e\u3067\u6ce8\u610f\u304c\u5fc5\u8981\u3067\u3059\u306d\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-11\">order\u5f15\u6570\u3067\u8981\u7d20\u306e\u4e26\u3073\u9806\u3092\u6307\u5b9a\u3059\u308b<\/h3>\n\n\n\n<p>reshape\u30e1\u30bd\u30c3\u30c9\u306b\u306f\u3001order\u5f15\u6570\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u3067\u3001\u8981\u7d20\u306e\u4e26\u3073\u9806\u3092\u5909\u66f4\u3067\u304d\u308b\u6a5f\u80fd\u3082\u3042\u308a\u307e\u3059\u3002\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u306forder=\u2019C\u2019\u3068\u306a\u3063\u3066\u304a\u308a\u3001\u3053\u308c\u306f\u884c\u512a\u5148\uff08C\u8a00\u8a9e\u98a8\uff09\u3067\u8981\u7d20\u304c\u4e26\u3076\u3053\u3068\u3092\u610f\u5473\u3057\u307e\u3059\u3002\u4e00\u65b9\u3001order=\u2019F\u2019\u3092\u6307\u5b9a\u3059\u308b\u3068\u3001\u5217\u512a\u5148\uff08Fortran\u98a8\uff09\u3067\u8981\u7d20\u304c\u4e26\u3073\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"># 2\u6b21\u5143\u914d\u5217\nmatrix_data = np.array([[1, 2, 3], [4, 5, 6]])\n\n# order='F'\u3092\u6307\u5b9a\u3057\u3066\u5217\u512a\u5148\u3067\u8981\u7d20\u3092\u4e26\u3079\u308b\nreshaped_data = matrix_data.reshape((3, 2), order='F')\nprint(reshaped_data)\n# [[1 4]\n#  [2 5]\n#  [3 6]]<\/pre>\n\n\n\n<p>\u3053\u306e\u4f8b\u3067\u306f\u3001order=\u2019F\u2019\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u3067\u3001\u5217\u512a\u5148\u3067\u8981\u7d20\u304c\u4e26\u3076\u3088\u3046\u306b\u914d\u5217\u306e\u5f62\u72b6\u3092\u5909\u66f4\u3057\u3066\u3044\u307e\u3059\u3002\u3053\u306e\u3088\u3046\u306b\u3001order\u5f15\u6570\u3092\u4f7f\u3048\u3070\u3001\u30c7\u30fc\u30bf\u306e\u4e26\u3073\u9806\u3092\u67d4\u8edf\u306b\u5236\u5fa1\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-12\">\u30e1\u30e2\u30ea\u4f7f\u7528\u91cf\u306b\u6ce8\u610f\u3057\u306a\u304c\u3089\u5f62\u72b6\u3092\u5909\u66f4\u3059\u308b<\/h3>\n\n\n\n<p>reshape\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u3046\u969b\u306f\u3001\u30e1\u30e2\u30ea\u4f7f\u7528\u91cf\u306b\u3082\u6ce8\u610f\u304c\u5fc5\u8981\u3067\u3059\u3002\u5b9f\u306f\u3001reshape\u30e1\u30bd\u30c3\u30c9\u306f\u65b0\u3057\u3044\u914d\u5217\u3092\u4f5c\u6210\u3059\u308b\u306e\u3067\u306f\u306a\u304f\u3001\u5143\u306e\u914d\u5217\u306e\u30c7\u30fc\u30bf\u3092\u53c2\u7167\u3059\u308b\uff08\u30d3\u30e5\u30fc\u3059\u308b\uff09\u305f\u3081\u3001\u30e1\u30e2\u30ea\u52b9\u7387\u306f\u975e\u5e38\u306b\u826f\u3044\u306e\u3067\u3059\u304c\u3001\u4e88\u671f\u3057\u306a\u3044\u554f\u984c\u304c\u767a\u751f\u3059\u308b\u30b1\u30fc\u30b9\u3082\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u7279\u306b\u3001\u5927\u898f\u6a21\u306a\u30c7\u30fc\u30bf\u3092\u6271\u3046\u969b\u306f\u3001\u30e1\u30e2\u30ea\u4f7f\u7528\u91cf\u306b\u6c17\u3092\u914d\u308a\u307e\u3057\u3087\u3046\u3002\u4ee5\u4e0b\u306e\u30b3\u30fc\u30c9\u4f8b\u306e\u3088\u3046\u306b\u3001reshape\u3092\u884c\u3046\u524d\u5f8c\u3067\u914d\u5217\u306e\u30e1\u30e2\u30ea\u4f7f\u7528\u91cf\uff08.nbytes\u5c5e\u6027\uff09\u3092\u78ba\u8a8d\u3057\u3066\u307f\u308b\u3068\u826f\u3044\u3067\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"># \u5927\u304d\u306a\u914d\u5217\u3092\u4f5c\u6210\nlarge_array = np.random.rand(1000000, 3)\n\n# reshape\u3092\u4f7f\u3063\u3066\u5f62\u72b6\u3092\u5909\u66f4\nreshaped_array = large_array.reshape((3, -1))\n\n# \u30e1\u30e2\u30ea\u4f7f\u7528\u91cf\u3092\u78ba\u8a8d\nprint(large_array.nbytes)     # 24000000\nprint(reshaped_array.nbytes)  # 24000000<\/pre>\n\n\n\n<p>\u3053\u306e\u4f8b\u304b\u3089\u3001reshape\u306e\u524d\u5f8c\u3067\u30e1\u30e2\u30ea\u4f7f\u7528\u91cf\u304c\u5909\u308f\u3089\u306a\u3044\u3053\u3068\u304c\u308f\u304b\u308a\u307e\u3059\u3002\u3064\u307e\u308a\u3001reshaped_array\u306f\u65b0\u3057\u3044\u30c7\u30fc\u30bf\u3092\u4f5c\u6210\u3057\u3066\u3044\u308b\u306e\u3067\u306f\u306a\u304f\u3001large_array\u3068\u540c\u3058\u30c7\u30fc\u30bf\u3092\u53c2\u7167\u3057\u3066\u3044\u308b\u306e\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u72b6\u6cc1\u306b\u5fdc\u3058\u3066\u306f\u3001copy\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u3063\u3066\u30c7\u30fc\u30bf\u3092\u660e\u793a\u7684\u306b\u30b3\u30d4\u30fc\u3059\u308b\u306e\u3082\u4e00\u3064\u306e\u624b\u6bb5\u3067\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"># copy\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u3063\u3066\u30c7\u30fc\u30bf\u3092\u30b3\u30d4\u30fc\ncopied_array = reshaped_array.copy()<\/pre>\n\n\n\n<p>\u3053\u306e\u3088\u3046\u306bcopy\u30e1\u30bd\u30c3\u30c9\u3092\u547c\u3073\u51fa\u305b\u3070\u3001\u65b0\u3057\u3044\u914d\u5217\u306b\u30c7\u30fc\u30bf\u304c\u30b3\u30d4\u30fc\u3055\u308c\u307e\u3059\u3002\u305f\u3060\u3057\u3001\u305d\u306e\u5206\u30e1\u30e2\u30ea\u4f7f\u7528\u91cf\u306f\u5897\u52a0\u3059\u308b\u306e\u3067\u3001\u30c8\u30ec\u30fc\u30c9\u30aa\u30d5\u3092\u8003\u3048\u306a\u304c\u3089\u4f7f\u3044\u5206\u3051\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u306d\u3002<\/p>\n\n\n\n<p>\u4ee5\u4e0a\u3001reshape\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u3044\u3053\u306a\u3059\u305f\u3081\u306e3\u3064\u306eTips\u3092\u7d39\u4ecb\u3057\u307e\u3057\u305f\u3002-1\u3092\u4f7f\u3063\u305f\u81ea\u52d5\u30b5\u30a4\u30ba\u8abf\u6574\u3001order\u5f15\u6570\u306b\u3088\u308b\u8981\u7d20\u306e\u4e26\u3073\u66ff\u3048\u3001\u30e1\u30e2\u30ea\u4f7f\u7528\u91cf\u3078\u306e\u6ce8\u610f\u70b9\u306a\u3069\u3092\u62bc\u3055\u3048\u3066\u304a\u3051\u3070\u3001\u3088\u308a\u52b9\u7387\u7684\u306breshape\u3092\u6d3b\u7528\u3067\u304d\u308b\u306f\u305a\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u6b21\u306f\u3001\u30c7\u30fc\u30bf\u5206\u6790\u3084\u6a5f\u68b0\u5b66\u7fd2\u306e\u5b9f\u8df5\u7684\u306a\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3067\u3001reshape\u30e1\u30bd\u30c3\u30c9\u304c\u3069\u306e\u3088\u3046\u306b\u5f79\u7acb\u3064\u306e\u304b\u3092\u5177\u4f53\u7684\u306b\u898b\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-13\">\u30c7\u30fc\u30bf\u5206\u6790\u3084\u6a5f\u68b0\u5b66\u7fd2\u3067reshape\u3092\u6d3b\u7528\u3057\u3088\u3046<\/h2>\n\n\n\n<p>\u3053\u308c\u307e\u3067\u3001reshape\u30e1\u30bd\u30c3\u30c9\u306e\u57fa\u672c\u7684\u306a\u4f7f\u3044\u65b9\u304b\u3089\u3001\u5b9f\u8df5\u7684\u306aTips\u307e\u3067\u5e45\u5e83\u304f\u898b\u3066\u304d\u307e\u3057\u305f\u304c\u3001\u3053\u3053\u3067\u306f\u30c7\u30fc\u30bf\u5206\u6790\u3084\u6a5f\u68b0\u5b66\u7fd2\u306e\u73fe\u5834\u3067\u3001reshape\u304c\u3069\u306e\u3088\u3046\u306b\u6d3b\u8e8d\u3059\u308b\u306e\u304b\u3092\u5177\u4f53\u7684\u306b\u898b\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-14\">\u753b\u50cf\u30c7\u30fc\u30bf\u306e\u524d\u51e6\u7406\u3067reshape\u304c\u5927\u6d3b\u8e8d<\/h3>\n\n\n\n<p>\u8fd1\u5e74\u306e\u6a5f\u68b0\u5b66\u7fd2\u3001\u7279\u306b\u30c7\u30a3\u30fc\u30d7\u30e9\u30fc\u30cb\u30f3\u30b0\u306e\u767a\u5c55\u306b\u4f34\u3044\u3001\u753b\u50cf\u30c7\u30fc\u30bf\u3092\u6271\u3046\u30bf\u30b9\u30af\u304c\u5897\u3048\u3066\u304d\u307e\u3057\u305f\u3002\u753b\u50cf\u30c7\u30fc\u30bf\u306f\u901a\u5e38\u3001(\u9ad8\u3055, \u5e45, \u30c1\u30e3\u30f3\u30cd\u30eb\u6570)\u306e3\u6b21\u5143\u914d\u5217\u3067\u8868\u73fe\u3055\u308c\u307e\u3059\u3002\u3057\u304b\u3057\u3001\u30cb\u30e5\u30fc\u30e9\u30eb\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306b\u753b\u50cf\u3092\u5165\u529b\u3059\u308b\u969b\u306f\u3001(\u30b5\u30f3\u30d7\u30eb\u6570, \u9ad8\u3055, \u5e45, \u30c1\u30e3\u30f3\u30cd\u30eb\u6570)\u306e4\u6b21\u5143\u914d\u5217\u306b\u5909\u63db\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u3053\u3053\u3067\u3001reshape\u30e1\u30bd\u30c3\u30c9\u304c\u5927\u6d3b\u8e8d\u3057\u307e\u3059\u3002\u4ee5\u4e0b\u306e\u30b3\u30fc\u30c9\u4f8b\u306e\u3088\u3046\u306b\u3001reshape\u3092\u4f7f\u3048\u3070\u3001\u3053\u306e\u5909\u63db\u3092\u7c21\u5358\u306b\u884c\u3048\u308b\u306e\u3067\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">import numpy as np\n\n# \u753b\u50cf\u30c7\u30fc\u30bf\u306e\u914d\u5217\uff08\u4f8b\uff1a28x28\u306e\u30b0\u30ec\u30fc\u30b9\u30b1\u30fc\u30eb\u753b\u50cf\u304c10\u679a\uff09\nimages = np.random.rand(10, 28, 28)\n\n# (\u30b5\u30f3\u30d7\u30eb\u6570, \u9ad8\u3055, \u5e45, \u30c1\u30e3\u30f3\u30cd\u30eb\u6570)\u306e4\u6b21\u5143\u914d\u5217\u306b\u5909\u63db\nreshaped_images = images.reshape((10, 28, 28, 1))\nprint(reshaped_images.shape)  # (10, 28, 28, 1)<\/pre>\n\n\n\n<p>\u3053\u306e\u3088\u3046\u306b\u3001reshape\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u3063\u3066\u753b\u50cf\u30c7\u30fc\u30bf\u306e\u5f62\u72b6\u3092\u5909\u63db\u3059\u308b\u3053\u3068\u3067\u3001\u30c7\u30a3\u30fc\u30d7\u30e9\u30fc\u30cb\u30f3\u30b0\u30e2\u30c7\u30eb\u3078\u306e\u5165\u529b\u30c7\u30fc\u30bf\u3092\u6e96\u5099\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-15\">\u6642\u7cfb\u5217\u30c7\u30fc\u30bf\u3092\u6271\u3046\u969b\u306breshape\u304c\u4fbf\u5229<\/h3>\n\n\n\n<p>\u6642\u7cfb\u5217\u30c7\u30fc\u30bf\u3001\u4f8b\u3048\u3070\u682a\u4fa1\u3084\u6c17\u6e29\u306e\u30c7\u30fc\u30bf\u3092\u5206\u6790\u3059\u308b\u969b\u306b\u3082\u3001reshape\u30e1\u30bd\u30c3\u30c9\u304c\u5f79\u7acb\u3061\u307e\u3059\u3002\u6642\u7cfb\u5217\u30c7\u30fc\u30bf\u306f\u3001\u3057\u3070\u3057\u3070(\u30b5\u30f3\u30d7\u30eb\u6570, \u6642\u9593\u30b9\u30c6\u30c3\u30d7\u6570)\u306e2\u6b21\u5143\u914d\u5217\u3067\u8868\u73fe\u3055\u308c\u307e\u3059\u304c\u3001LSTM\u306a\u3069\u306e\u6642\u7cfb\u5217\u30e2\u30c7\u30eb\u306b\u5165\u529b\u3059\u308b\u969b\u306f\u3001(\u30b5\u30f3\u30d7\u30eb\u6570, \u6642\u9593\u30b9\u30c6\u30c3\u30d7\u6570, \u7279\u5fb4\u91cf\u6570)\u306e3\u6b21\u5143\u914d\u5217\u306b\u5909\u63db\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>reshape\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u3048\u3070\u3001\u3053\u306e\u5909\u63db\u3082\u7c21\u6f54\u306b\u884c\u3048\u307e\u3059\u3002\u4ee5\u4e0b\u306e\u30b3\u30fc\u30c9\u4f8b\u3092\u898b\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"># \u6642\u7cfb\u5217\u30c7\u30fc\u30bf\u306e\u914d\u5217\uff08\u4f8b\uff1a100\u500b\u306e\u30b5\u30f3\u30d7\u30eb\u3001\u540450\u30b9\u30c6\u30c3\u30d7\uff09\ntime_series = np.random.rand(100, 50)\n\n# (\u30b5\u30f3\u30d7\u30eb\u6570, \u6642\u9593\u30b9\u30c6\u30c3\u30d7\u6570, \u7279\u5fb4\u91cf\u6570)\u306e3\u6b21\u5143\u914d\u5217\u306b\u5909\u63db\nreshaped_time_series = time_series.reshape((100, 50, 1))\nprint(reshaped_time_series.shape)  # (100, 50, 1)<\/pre>\n\n\n\n<p>\u3053\u306e\u3088\u3046\u306breshape\u30e1\u30bd\u30c3\u30c9\u3092\u6d3b\u7528\u3059\u308b\u3053\u3068\u3067\u3001\u6642\u7cfb\u5217\u30c7\u30fc\u30bf\u306e\u5f62\u72b6\u3092\u6642\u7cfb\u5217\u30e2\u30c7\u30eb\u306b\u5408\u308f\u305b\u3066\u5909\u63db\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-16\">\u30e2\u30c7\u30eb\u306e\u5165\u51fa\u529b\u3068\u30c7\u30fc\u30bf\u5f62\u72b6\u3092\u4e00\u81f4\u3055\u305b\u308b\u305f\u3081\u306breshape\u3092\u4f7f\u3046<\/h3>\n\n\n\n<p>\u6a5f\u68b0\u5b66\u7fd2\u30e2\u30c7\u30eb\u3092\u69cb\u7bc9\u3059\u308b\u969b\u3001\u5165\u529b\u30c7\u30fc\u30bf\u306e\u5f62\u72b6\u306f\u30e2\u30c7\u30eb\u306e\u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3\u306b\u4f9d\u5b58\u3057\u3001\u51fa\u529b\u30c7\u30fc\u30bf\u306e\u5f62\u72b6\u3082\u30bf\u30b9\u30af\u306b\u3088\u3063\u3066\u7570\u306a\u308a\u307e\u3059\u3002reshape\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u3048\u3070\u3001\u30c7\u30fc\u30bf\u306e\u5f62\u72b6\u3092\u30e2\u30c7\u30eb\u306e\u5165\u51fa\u529b\u306b\u5408\u308f\u305b\u3066\u8abf\u6574\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u4ee5\u4e0b\u306f\u3001scikit-learn\u3092\u4f7f\u3063\u3066\u30a2\u30e4\u30e1\u306e\u5206\u985e\u3092\u884c\u3046\u4f8b\u3067\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">from sklearn.datasets import load_iris\nfrom sklearn.linear_model import LogisticRegression\nfrom sklearn.preprocessing import StandardScaler\n\n# \u30a2\u30e4\u30e1\u306e\u30c7\u30fc\u30bf\u3092\u30ed\u30fc\u30c9\niris = load_iris()\nX, y = iris.data, iris.target\n\n# \u30c7\u30fc\u30bf\u306e\u5f62\u72b6\u3092\u78ba\u8a8d\nprint(X.shape)  # (150, 4)\nprint(y.shape)  # (150,)\n\n# \u30c7\u30fc\u30bf\u306e\u6a19\u6e96\u5316\nscaler = StandardScaler()\nX_scaled = scaler.fit_transform(X)\n\n# \u30e2\u30c7\u30eb\u306e\u8a13\u7df4\nmodel = LogisticRegression(max_iter=1000, solver='liblinear')\nmodel.fit(X_scaled, y)\n\n# \u30e2\u30c7\u30eb\u306e\u51fa\u529b\u306e\u5f62\u72b6\u3092\u78ba\u8a8d\nprint(model.predict(X_scaled).shape)  # (150,)\nprint(model.predict_proba(X_scaled).shape)  # (150, 3)\n\n# \u51fa\u529b\u306e\u5f62\u72b6\u3092\u5909\u66f4\uff08\u4f8b\uff1a\u78ba\u7387\u309250x3\u306e\u884c\u5217\u306b\u5909\u63db\uff09\nreshaped_proba = model.predict_proba(X_scaled).reshape((50, 3, 3))\nprint(reshaped_proba.shape)  # (50, 3, 3)<\/pre>\n\n\n\n<p>\u3053\u3053\u3067\u306f\u3001\u30ed\u30b8\u30b9\u30c6\u30a3\u30c3\u30af\u56de\u5e30\u30e2\u30c7\u30eb\u306e\u51fa\u529b\uff08\u30af\u30e9\u30b9\u4e88\u6e2c\u3068\u78ba\u7387\uff09\u306e\u5f62\u72b6\u3092\u78ba\u8a8d\u3057\u305f\u5f8c\u3001predict_proba()\u306e\u51fa\u529b\u309250\u00d750\u00d73\u306e\u884c\u5217\u306b\u5909\u63db\u3057\u3066\u3044\u307e\u3059\u3002\u3053\u306e\u3088\u3046\u306b\u3001reshape\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u3048\u3070\u3001\u30e2\u30c7\u30eb\u306e\u51fa\u529b\u5f62\u72b6\u3092\u81ea\u7531\u306b\u5909\u66f4\u3067\u304d\u308b\u306e\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u4ee5\u4e0a\u3001\u30c7\u30fc\u30bf\u5206\u6790\u3084\u6a5f\u68b0\u5b66\u7fd2\u306e\u5b9f\u8df5\u306e\u5834\u3067\u3001reshape\u30e1\u30bd\u30c3\u30c9\u304c\u3069\u306e\u3088\u3046\u306b\u6d3b\u7528\u3055\u308c\u3066\u3044\u308b\u304b\u3092\u898b\u3066\u304d\u307e\u3057\u305f\u3002\u753b\u50cf\u3084\u6642\u7cfb\u5217\u30c7\u30fc\u30bf\u306e\u524d\u51e6\u7406\u3001\u30e2\u30c7\u30eb\u306e\u5165\u51fa\u529b\u30c7\u30fc\u30bf\u306e\u5f62\u72b6\u8abf\u6574\u306a\u3069\u3001\u305d\u306e\u6d3b\u8e8d\u306e\u5834\u9762\u306f\u5b9f\u306b\u591a\u5c90\u306b\u308f\u305f\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u30c7\u30fc\u30bf\u30b5\u30a4\u30a8\u30f3\u30c6\u30a3\u30b9\u30c8\u3092\u76ee\u6307\u3059\u65b9\u306f\u3001\u305c\u3072reshape\u30e1\u30bd\u30c3\u30c9\u3092\u7fd2\u5f97\u3057\u3066\u3001\u30c7\u30fc\u30bf\u51e6\u7406\u306e\u30b9\u30ad\u30eb\u3092\u78e8\u3044\u3066\u3044\u3063\u3066\u304f\u3060\u3055\u3044\u3002NumPy\u3084Pandas\u3092\u4f7f\u3063\u305f\u30c7\u30fc\u30bf\u64cd\u4f5c\u3001scikit-learn\u3084Keras\u3092\u7528\u3044\u305f\u6a5f\u68b0\u5b66\u7fd2\u306a\u3069\u3001\u3042\u3089\u3086\u308b\u5834\u9762\u3067\u304d\u3063\u3068reshape\u306f\u5f37\u529b\u306a\u5473\u65b9\u306b\u306a\u3063\u3066\u304f\u308c\u308b\u306f\u305a\u3067\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Python\u3067\u30c7\u30fc\u30bf\u5206\u6790\u3084\u6a5f\u68b0\u5b66\u7fd2\u3092\u884c\u3046\u4e0a\u3067\u6b20\u304b\u305b\u306a\u3044NumPy\u306ereshape\u30e1\u30bd\u30c3\u30c9\u3002\u914d\u5217\u306e\u5f62\u72b6\u3092\u81ea\u7531\u81ea\u5728\u306b\u5909\u66f4\u3067\u304d\u308b\u3053\u306e\u5f37\u529b\u306a\u6a5f\u80fd\u3092\u3001\u5b9f\u4f8b\u3092\u4ea4\u3048\u3066\u308f\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3057\u307e\u3059\u3002\u57fa\u672c\u7684\u306a\u4f7f\u3044\u65b9\u304b\u3089\u5b9f\u8df5\u7684\u306aTips\u307e\u3067\u3001re &#8230; <\/p>\n","protected":false},"author":1,"featured_media":845,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":{"0":"post-844","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-python"},"_links":{"self":[{"href":"https:\/\/chocottopro.com\/index.php?rest_route=\/wp\/v2\/posts\/844","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/chocottopro.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/chocottopro.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/chocottopro.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/chocottopro.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=844"}],"version-history":[{"count":1,"href":"https:\/\/chocottopro.com\/index.php?rest_route=\/wp\/v2\/posts\/844\/revisions"}],"predecessor-version":[{"id":846,"href":"https:\/\/chocottopro.com\/index.php?rest_route=\/wp\/v2\/posts\/844\/revisions\/846"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/chocottopro.com\/index.php?rest_route=\/wp\/v2\/media\/845"}],"wp:attachment":[{"href":"https:\/\/chocottopro.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=844"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/chocottopro.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=844"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/chocottopro.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=844"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}