{"id":74,"date":"2014-06-23T23:21:16","date_gmt":"2014-06-23T14:21:16","guid":{"rendered":"https:\/\/www.dogrow.net\/python\/?p=74"},"modified":"2019-10-19T06:34:59","modified_gmt":"2019-10-18T21:34:59","slug":"blog23","status":"publish","type":"post","link":"https:\/\/www.dogrow.net\/python\/blog23\/","title":{"rendered":"(23) numpy\u3067\u8981\u7d20\u6570\u306e\u7570\u306a\u308b\u914d\u5217\u306e\u8a08\u7b97"},"content":{"rendered":"<p>\u4f8b\u3068\u3057\u3066\u30015\u884c5\u5217\u306e\u914d\u5217 a\u3068\u30015\u884c1\u5217\u306e\u914d\u5217 b\u3092\u7528\u610f\u3059\u308b\u3002<\/p>\n<pre>\r\n>>> a=np.eye(5)\r\n>>> a\r\narray([[ 1.,  0.,  0.,  0.,  0.],\r\n       [ 0.,  1.,  0.,  0.,  0.],\r\n       [ 0.,  0.,  1.,  0.,  0.],\r\n       [ 0.,  0.,  0.,  1.,  0.],\r\n       [ 0.,  0.,  0.,  0.,  1.]])\r\n>>>\r\n>>> b=np.ones([5,1])\r\n>>> b\r\narray([[ 1.],\r\n       [ 1.],\r\n       [ 1.],\r\n       [ 1.],\r\n       [ 1.]])\r\n<\/pre>\n<p>\u3053\u306e\u5834\u5408\u3001a+b\u306f b\u3092 5\u884c5\u5217\u306b\u62e1\u5f35\u3057\u305f\u5f8c\u306b\u7a4d\u7b97\u3055\u308c\u308b\u3002<\/p>\n<pre>\r\n>>> a+b\r\narray([[ 2.,  1.,  1.,  1.,  1.],\r\n       [ 1.,  2.,  1.,  1.,  1.],\r\n       [ 1.,  1.,  2.,  1.,  1.],\r\n       [ 1.,  1.,  1.,  2.,  1.],\r\n       [ 1.,  1.,  1.,  1.,  2.]])\r\n<\/pre>\n<hr class=\"my_hr_bottom\">\n","protected":false},"excerpt":{"rendered":"<p>\u4f8b\u3068\u3057\u3066\u30015\u884c5\u5217\u306e\u914d\u5217 a\u3068\u30015\u884c1\u5217\u306e\u914d\u5217 b\u3092\u7528\u610f\u3059\u308b\u3002 >>> a=np.eye(5) >>> a array([[ 1., 0., 0., 0., 0.], [ 0., 1., 0., 0., 0.], [ 0\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.dogrow.net\/python\/blog23\/\">\u7d9a\u304d\u3092\u8aad\u3080 &raquo;<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[],"class_list":["post-74","post","type-post","status-publish","format-standard","hentry","category-numpy"],"views":8390,"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.dogrow.net\/python\/wp-json\/wp\/v2\/posts\/74","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dogrow.net\/python\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dogrow.net\/python\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dogrow.net\/python\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dogrow.net\/python\/wp-json\/wp\/v2\/comments?post=74"}],"version-history":[{"count":9,"href":"https:\/\/www.dogrow.net\/python\/wp-json\/wp\/v2\/posts\/74\/revisions"}],"predecessor-version":[{"id":2609,"href":"https:\/\/www.dogrow.net\/python\/wp-json\/wp\/v2\/posts\/74\/revisions\/2609"}],"wp:attachment":[{"href":"https:\/\/www.dogrow.net\/python\/wp-json\/wp\/v2\/media?parent=74"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dogrow.net\/python\/wp-json\/wp\/v2\/categories?post=74"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dogrow.net\/python\/wp-json\/wp\/v2\/tags?post=74"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}