{"id":247,"date":"2020-05-02T13:57:39","date_gmt":"2020-05-02T04:57:39","guid":{"rendered":"https:\/\/shibaura-it.tokyo\/it-solution\/?p=247"},"modified":"2020-05-02T13:57:39","modified_gmt":"2020-05-02T04:57:39","slug":"ones-numpy","status":"publish","type":"post","link":"https:\/\/shibaura-it.tokyo\/it-solution\/ones-numpy\/","title":{"rendered":"ones (NumPy)"},"content":{"rendered":"<p>\u914d\u5217\u306b\u201d1\u201d\u3092\u4ee3\u5165\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true \">import numpy as np\r\n\r\n# \u30b5\u30f3\u30d7\u30eb\u914d\u5217\u306e\u4f5c\u6210\r\n# 0 - 180deg\u306e\u7bc4\u56f2\u309210deg\u523b\u307f\u3067\u30e9\u30b8\u30a2\u30f3\u306b\u5909\u63db\u3057\u305f\u914d\u5217\u3092\u4f5c\u6210\r\nvals = np.linspace(0, 180. \/ np.pi, 19)\r\n\r\nprint(vals)\r\n<\/pre>\n<p>\u3053\u306e\u7d50\u679c\u306f<\/p>\n<pre class=\"lang:batch decode:true\">[ 0.          3.18309886  6.36619772  9.54929659 12.73239545 15.91549431\r\n 19.09859317 22.28169203 25.46479089 28.64788976 31.83098862 35.01408748\r\n 38.19718634 41.3802852  44.56338407 47.74648293 50.92958179 54.11268065\r\n 57.29577951]\r\n<\/pre>\n<p>\u4e0a\u8a18\u3067\u4f5c\u6210\u3057\u305f<\/p>\n<pre class=\"lang:python decode:true \">import numpy as np\r\n\r\n# \u30b5\u30f3\u30d7\u30eb\u914d\u5217\u306e\u4f5c\u6210\r\n# 0 - 180deg\u306e\u7bc4\u56f2\u309210deg\u523b\u307f\u3067\u30e9\u30b8\u30a2\u30f3\u306b\u5909\u63db\u3057\u305f\u914d\u5217\u3092\u4f5c\u6210\r\nvals = np.linspace(0, 180. \/ np.pi, 19)\r\n\r\n# \u914d\u5217vals\u306b\u5bfe\u3057\u3066\u3001\u3059\u3079\u3066\"1\"\u3092\u4ee3\u5165\u3057\u305f\u914d\u5217\u3092\u4f5c\u6210\r\nans = np.ones(len(vals))\r\nprint(ans)<\/pre>\n<p>\u7d50\u679c\u306f<\/p>\n<pre class=\"lang:python decode:true\">[1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1.]\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u914d\u5217\u306b\u201d1\u201d\u3092\u4ee3\u5165\u3057\u307e\u3059\u3002 import numpy as np #&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":243,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"_links":{"self":[{"href":"https:\/\/shibaura-it.tokyo\/it-solution\/wp-json\/wp\/v2\/posts\/247"}],"collection":[{"href":"https:\/\/shibaura-it.tokyo\/it-solution\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/shibaura-it.tokyo\/it-solution\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/shibaura-it.tokyo\/it-solution\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/shibaura-it.tokyo\/it-solution\/wp-json\/wp\/v2\/comments?post=247"}],"version-history":[{"count":1,"href":"https:\/\/shibaura-it.tokyo\/it-solution\/wp-json\/wp\/v2\/posts\/247\/revisions"}],"predecessor-version":[{"id":248,"href":"https:\/\/shibaura-it.tokyo\/it-solution\/wp-json\/wp\/v2\/posts\/247\/revisions\/248"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/shibaura-it.tokyo\/it-solution\/wp-json\/wp\/v2\/media\/243"}],"wp:attachment":[{"href":"https:\/\/shibaura-it.tokyo\/it-solution\/wp-json\/wp\/v2\/media?parent=247"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/shibaura-it.tokyo\/it-solution\/wp-json\/wp\/v2\/categories?post=247"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/shibaura-it.tokyo\/it-solution\/wp-json\/wp\/v2\/tags?post=247"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}