{"id":1230,"date":"2017-08-21T19:55:35","date_gmt":"2017-08-21T10:55:35","guid":{"rendered":"http:\/\/www.python.ambitious-engineer.com\/?p=1230"},"modified":"2018-02-25T12:12:22","modified_gmt":"2018-02-25T03:12:22","slug":"numpy%e5%85%a5%e9%96%80-%e8%a1%8c%e5%88%972%e6%ac%a1%e5%85%83%e9%85%8d%e5%88%97%e7%94%9f%e6%88%90","status":"publish","type":"post","link":"https:\/\/www.python.ambitious-engineer.com\/archives\/1230","title":{"rendered":"NumPy\u5165\u9580 \u884c\u5217(2\u6b21\u5143\u914d\u5217)\u751f\u6210"},"content":{"rendered":"<p>\u3053\u306e\u30da\u30fc\u30b8\u3067\u306fNumPy\u3092\u4f7f\u7528\u3057\u3066\u884c\u5217\u3092\u751f\u6210\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u5b66\u7fd2\u3057\u307e\u3059\u3002<\/p>\n<h2>\u884c\u5217(2\u6b21\u5143\u914d\u5217)<\/h2>\n<p>np.array\u306e\u5f15\u6570\u306b2\u6b21\u5143\u306e\u30ea\u30b9\u30c8\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u3067\u884c\u5217\u3092\u8868\u3059\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u305f\u3068\u3048\u3070\u30013\u884c3\u5217\u306e\u884c\u5217\u3092\u751f\u6210\u3059\u308b\u5834\u5408\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u8a18\u8ff0\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\nx = np.array([[11 , 12, 13], [21, 22, 23], [31, 32, 33]])\r\n# array([[11, 12, 13],\r\n#        [21, 22, 23],\r\n#        [31, 32, 33]])\r\n\r\n<\/pre>\n<p><\/p>\n<h2>\u30c7\u30fc\u30bf\u30a2\u30af\u30bb\u30b9<\/h2>\n<p>\u3067\u306f\u6b21\u306b\u751f\u6210\u3057\u305f\u884c\u5217\u306b\u5bfe\u3057\u3066\u30a2\u30af\u30bb\u30b9\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<h3>\u8981\u7d20\u3092\u53d6\u5f97<\/h3>\n<p>\u884c\u3001\u5217\u306e\u9806\u3067\u6dfb\u5b57\u3092\u6307\u5b9a\u3059\u308b\u3068\u884c\u5217\u8981\u7d20\u3092\u53d6\u5f97\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\nimport numpy as np\r\nx = np.array([[11 , 12, 13], [21, 22, 23], [31, 32, 33]])\r\n# array([[11, 12, 13],\r\n#        [21, 22, 23],\r\n#        [31, 32, 33]])\r\n\r\nx[0, 2] # 1\u884c3\u5217\u306e13\u304c\u53d6\u5f97\u3067\u304d\u308b\r\nx[2, 0] # 3\u884c1\u5217\u306e31\u304c\u53d6\u5f97\u3067\u304d\u308b\r\n<\/pre>\n<h3>\u30b9\u30e9\u30a4\u30b9<\/h3>\n<p>\u30b9\u30e9\u30a4\u30b9\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u30022 x 2\u306e\u90e8\u5206\u884c\u5217\u3092\u62bd\u51fa\u3059\u308b\u5834\u5408\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u8a18\u8ff0\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\nimport numpy as np\r\nx = np.array([[11 , 12, 13], [21, 22, 23], [31, 32, 33]])\r\n\r\nx[0:2, 0:2]\r\n# array([[11, 12],\r\n#        [21, 22]])\r\n<\/pre>\n<h3>\u884c\u306e\u62bd\u51fa<\/h3>\n<p>\u6700\u521d\u306e\u6dfb\u5b57\u3060\u3051\u3092\u6307\u5b9a\u3059\u308b\u3068\u3001\u884c\u3092\u62bd\u51fa\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u30021\u884c\u3081\u3092\u53d6\u5f97\u3059\u308b\u5834\u5408\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u8a18\u8ff0\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\nimport numpy as np\r\nx = np.array([[11 , 12, 13], [21, 22, 23], [31, 32, 33]])\r\n\r\nrow = x[0]\r\n# array([11, 12, 13])\r\n<\/pre>\n<p><\/p>\n<h3>\u5217\u306e\u62bd\u51fa<\/h3>\n<p>\u30b9\u30e9\u30a4\u30b9\u304c\u53ef\u80fd\u3067\u3059\u306e\u3067\u3001\u884c\u3092\u5168\u3066(\u30b3\u30ed\u30f3)\u6307\u5b9a\u3059\u308b\u30682\u756a\u3081\u306e\u6dfb\u5b57\u3067\u5217\u3092\u62bd\u51fa\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\nimport numpy as np\r\nx = np.array([[11 , 12, 13], [21, 22, 23], [31, 32, 33]])\r\ncol = x[:, 1] # \uff10\u304b\u3089\u6570\u3048\u30661\u756a\u76ee\u306e\u5217\u3092\u53d6\u5f97\r\n# array([12, 22, 32])\r\n# \r\n<\/pre>\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3053\u306e\u30da\u30fc\u30b8\u3067\u306fNumPy\u3092\u4f7f\u7528\u3057\u3066\u884c\u5217\u3092\u751f\u6210\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u5b66\u7fd2\u3057\u307e\u3059\u3002 \u884c\u5217(2\u6b21\u5143\u914d\u5217) np.array\u306e\u5f15\u6570\u306b2\u6b21\u5143\u306e\u30ea\u30b9\u30c8\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u3067\u884c\u5217\u3092\u8868\u3059\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u305f\u3068\u3048\u3070\u30013\u884c3\u5217\u306e\u884c\u5217\u3092\u751f\u6210\u3059\u308b\u5834\u5408\u306f\u4ee5\u4e0b\u306e...<\/p>\n","protected":false},"author":1,"featured_media":1607,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[168],"tags":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.python.ambitious-engineer.com\/wp-json\/wp\/v2\/posts\/1230"}],"collection":[{"href":"https:\/\/www.python.ambitious-engineer.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.python.ambitious-engineer.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.python.ambitious-engineer.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.python.ambitious-engineer.com\/wp-json\/wp\/v2\/comments?post=1230"}],"version-history":[{"count":8,"href":"https:\/\/www.python.ambitious-engineer.com\/wp-json\/wp\/v2\/posts\/1230\/revisions"}],"predecessor-version":[{"id":3503,"href":"https:\/\/www.python.ambitious-engineer.com\/wp-json\/wp\/v2\/posts\/1230\/revisions\/3503"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.python.ambitious-engineer.com\/wp-json\/wp\/v2\/media\/1607"}],"wp:attachment":[{"href":"https:\/\/www.python.ambitious-engineer.com\/wp-json\/wp\/v2\/media?parent=1230"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.python.ambitious-engineer.com\/wp-json\/wp\/v2\/categories?post=1230"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.python.ambitious-engineer.com\/wp-json\/wp\/v2\/tags?post=1230"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}