{"id":69,"date":"2014-06-23T23:12:26","date_gmt":"2014-06-23T14:12:26","guid":{"rendered":"https:\/\/www.dogrow.net\/python\/?p=69"},"modified":"2019-10-19T06:32:06","modified_gmt":"2019-10-18T21:32:06","slug":"blog22","status":"publish","type":"post","link":"https:\/\/www.dogrow.net\/python\/blog22\/","title":{"rendered":"(22) numpy\u3067\u914d\u5217\u306e\u8db3\u3057\u7b97\u30fb\u5f15\u304d\u7b97"},"content":{"rendered":"<p>\u307e\u305a\u306f\u30015\u884c3\u5217\u306e\u914d\u5217\u5909\u6570\u30923\u500b\u4f5c\u3063\u3066\u307f\u308b\u3002<\/p>\n<pre>\r\n>>> a=np.zeros([5,3])\r\n>>> a\r\narray([[ 0.,  0.,  0.],\r\n       [ 0.,  0.,  0.],\r\n       [ 0.,  0.,  0.],\r\n       [ 0.,  0.,  0.],\r\n       [ 0.,  0.,  0.]])\r\n>>>\r\n>>> b=np.ones([5,3])\r\n>>> b\r\narray([[ 1.,  1.,  1.],\r\n       [ 1.,  1.,  1.],\r\n       [ 1.,  1.,  1.],\r\n       [ 1.,  1.,  1.],\r\n       [ 1.,  1.,  1.]])\r\n>>>\r\n>>> c=np.random.rand(5,3)\r\n>>> c\r\narray([[ 0.16668109,  0.16426297,  0.33385086],\r\n       [ 0.47174275,  0.44352061,  0.67223213],\r\n       [ 0.79063585,  0.06861268,  0.59725334],\r\n       [ 0.90522505,  0.93270762,  0.27228631],\r\n       [ 0.57300036,  0.93921266,  0.00304121]])\r\n<\/pre>\n<p>\u8db3\u3057\u7b97\u30fb\u5f15\u304d\u7b97\u3057\u3066\u307f\u308b\u3002<\/p>\n<pre>\r\n>>> a+b\r\narray([[ 1.,  1.,  1.],\r\n       [ 1.,  1.,  1.],\r\n       [ 1.,  1.,  1.],\r\n       [ 1.,  1.,  1.],\r\n       [ 1.,  1.,  1.]])\r\n>>>\r\n>>> a+b*2\r\narray([[ 2.,  2.,  2.],\r\n       [ 2.,  2.,  2.],\r\n       [ 2.,  2.,  2.],\r\n       [ 2.,  2.,  2.],\r\n       [ 2.,  2.,  2.]])\r\n>>>\r\n>>> b+c\r\narray([[ 1.16668109,  1.16426297,  1.33385086],\r\n       [ 1.47174275,  1.44352061,  1.67223213],\r\n       [ 1.79063585,  1.06861268,  1.59725334],\r\n       [ 1.90522505,  1.93270762,  1.27228631],\r\n       [ 1.57300036,  1.93921266,  1.00304121]])\r\n>>>\r\n>>> b+b+c\r\narray([[ 2.16668109,  2.16426297,  2.33385086],\r\n       [ 2.47174275,  2.44352061,  2.67223213],\r\n       [ 2.79063585,  2.06861268,  2.59725334],\r\n       [ 2.90522505,  2.93270762,  2.27228631],\r\n       [ 2.57300036,  2.93921266,  2.00304121]])\r\n>>>\r\n>>> b*2-c\r\narray([[ 1.83331891,  1.83573703,  1.66614914],\r\n       [ 1.52825725,  1.55647939,  1.32776787],\r\n       [ 1.20936415,  1.93138732,  1.40274666],\r\n       [ 1.09477495,  1.06729238,  1.72771369],\r\n       [ 1.42699964,  1.06078734,  1.99695879]])\r\n<\/pre>\n<hr class=\"my_hr_bottom\">\n","protected":false},"excerpt":{"rendered":"<p>\u307e\u305a\u306f\u30015\u884c3\u5217\u306e\u914d\u5217\u5909\u6570\u30923\u500b\u4f5c\u3063\u3066\u307f\u308b\u3002 >>> a=np.zeros([5,3]) >>> a array([[ 0., 0., 0.], [ 0., 0., 0.], [ 0., 0., 0.], [ 0., 0\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.dogrow.net\/python\/blog22\/\">\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-69","post","type-post","status-publish","format-standard","hentry","category-numpy"],"views":4778,"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.dogrow.net\/python\/wp-json\/wp\/v2\/posts\/69","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=69"}],"version-history":[{"count":8,"href":"https:\/\/www.dogrow.net\/python\/wp-json\/wp\/v2\/posts\/69\/revisions"}],"predecessor-version":[{"id":2604,"href":"https:\/\/www.dogrow.net\/python\/wp-json\/wp\/v2\/posts\/69\/revisions\/2604"}],"wp:attachment":[{"href":"https:\/\/www.dogrow.net\/python\/wp-json\/wp\/v2\/media?parent=69"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dogrow.net\/python\/wp-json\/wp\/v2\/categories?post=69"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dogrow.net\/python\/wp-json\/wp\/v2\/tags?post=69"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}