{"id":1234,"date":"2017-08-22T20:16:55","date_gmt":"2017-08-22T11:16:55","guid":{"rendered":"http:\/\/www.python.ambitious-engineer.com\/?p=1234"},"modified":"2018-02-25T12:12:05","modified_gmt":"2018-02-25T03:12:05","slug":"numpy%e5%85%a5%e9%96%80-%e5%9e%8b%e3%81%a8%e5%9e%8b%e5%a4%89%e6%8f%9b","status":"publish","type":"post","link":"https:\/\/www.python.ambitious-engineer.com\/archives\/1234","title":{"rendered":"NumPy\u5165\u9580 \u578b\u3068\u578b\u5909\u63db"},"content":{"rendered":"<p>NumPy\u306b\u306fPython\u306e\u578b\u3068\u306f\u5225\u306b\u72ec\u81ea\u306e\u578b\u304c\u7528\u610f\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<h2>NumPy\u306e\u578b<\/h2>\n<p>\u4ee5\u4e0bURL\u304b\u3089\u57fa\u672c\u7684\u306a\u6f14\u7b97\u3067\u3088\u304f\u4f7f\u7528\u3059\u308b\u3082\u306e\u3092\u629c\u7c8b\u3057\u307e\u3057\u305f\u3002<br \/>\n<a href=\"https:\/\/docs.scipy.org\/doc\/numpy-dev\/user\/basics.types.html\">https:\/\/docs.scipy.org\/doc\/numpy-dev\/user\/basics.types.html<\/a><\/p>\n<table>\n<thead>\n<tr>\n<th>\u578b<\/th>\n<th>\u8aac\u660e<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>bool<\/td>\n<td>\u771f\u507d\u578b<\/td>\n<\/tr>\n<tr>\n<td>int8<\/td>\n<td>8\u30d3\u30c3\u30c8\u7b26\u53f7\u4ed8\u304d\u6574\u6570<\/td>\n<\/tr>\n<tr>\n<td>int16<\/td>\n<td>16\u30d3\u30c3\u30c8\u7b26\u53f7\u4ed8\u304d\u6574\u6570<\/td>\n<\/tr>\n<tr>\n<td>int32<\/td>\n<td>32\u30d3\u30c3\u30c8\u7b26\u53f7\u4ed8\u304d\u6574\u6570<\/td>\n<\/tr>\n<tr>\n<td>int64<\/td>\n<td>64\u30d3\u30c3\u30c8\u7b26\u53f7\u4ed8\u304d\u6574\u6570<\/td>\n<\/tr>\n<tr>\n<td>uint8<\/td>\n<td>8\u30d3\u30c3\u30c8\u7b26\u53f7\u306a\u3057\u6574\u6570<\/td>\n<\/tr>\n<tr>\n<td>uint16<\/td>\n<td>16\u30d3\u30c3\u30c8\u7b26\u53f7\u306a\u3057\u6574\u6570<\/td>\n<\/tr>\n<tr>\n<td>uint32<\/td>\n<td>32\u30d3\u30c3\u30c8\u7b26\u53f7\u306a\u3057\u6574\u6570<\/td>\n<\/tr>\n<tr>\n<td>uint64<\/td>\n<td>64\u30d3\u30c3\u30c8\u7b26\u53f7\u306a\u3057\u6574\u6570<\/td>\n<\/tr>\n<tr>\n<td>float16<\/td>\n<td>16\u30d3\u30c3\u30c8\u6d6e\u52d5\u5c0f\u6570\u70b9<\/td>\n<\/tr>\n<tr>\n<td>float32<\/td>\n<td>32\u30d3\u30c3\u30c8\u6d6e\u52d5\u5c0f\u6570\u70b9<\/td>\n<\/tr>\n<tr>\n<td>float64<\/td>\n<td>64\u30d3\u30c3\u30c8\u6d6e\u52d5\u5c0f\u6570\u70b9<\/td>\n<\/tr>\n<tr>\n<td>complex64<\/td>\n<td>64\u30d3\u30c3\u30c8\u8907\u7d20\u6570<\/td>\n<\/tr>\n<tr>\n<td>complex128<\/td>\n<td>\uff11\uff12\uff18\u30d3\u30c3\u30c8\u8907\u7d20\u6570<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u4e0a\u8a18\u4ee5\u5916\u306b\u3082\u3001C\u8a00\u8a9e\u3068\u4e92\u63db\u306e\u578b\u306a\u3069\u304c\u3042\u308a\u307e\u3059\u3002\u8a73\u7d30\u306f\u30ea\u30f3\u30af\u5148\u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<h2>\u578b\u306e\u6307\u5b9a<\/h2>\n<p><a href=\"http:\/\/www.python.ambitious-engineer.com\/archives\/1225\">\u3053\u3053<\/a>\u3067\u3082\u5c11\u3057\u8aac\u660e\u3057\u307e\u3057\u305f\u304c\u3001\u914d\u5217\u306e\u751f\u6210\u6642\u306bdtype\u3067\u578b\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u914d\u5217\u5168\u3066\u306e\u8981\u7d20\u304c\u540c\u3058\u578b\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u578b\u3092\u6307\u5b9a\u3059\u308b\u5834\u5408\u306f\u6587\u5b57\u5217\u304b\u3001nu.\u578b\u540d\u3067\u6307\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\nimport numpy as np\r\n\r\n# \u6587\u5b57\u5217\u3067\u6307\u5b9a\r\nx = np.array([1, 2, 3], dtype='int64')\r\n\r\n# np.\u3067\u6307\u5b9a\r\nx = np.array([1, 2, 3], dtype=np.int64)\r\n<\/pre>\n<h2>\u578b\u5909\u63db<\/h2>\n<p>\u4f5c\u6210\u5f8c\u306e\u914d\u5217\u306b\u5bfe\u3057\u3066astype\u3092\u4f7f\u7528\u3057\u3066\u578b\u5909\u63db\u3092\u884c\u3046\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u4f8b\u3048\u3070int32\u304b\u3089float32\u306b\u578b\u3092\u5909\u3048\u308b\u5834\u5408\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\nimport numpy as np\r\nx = np.array([1, 2, 3, 4, 5], dtype='int32')\r\ny = x.astype('float32')\r\n<\/pre>\n<p>\u5143\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306f\u7834\u58ca\u3055\u308c\u306a\u3044\u70b9\u306b\u6ce8\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>NumPy\u306b\u306fPython\u306e\u578b\u3068\u306f\u5225\u306b\u72ec\u81ea\u306e\u578b\u304c\u7528\u610f\u3055\u308c\u3066\u3044\u307e\u3059\u3002 NumPy\u306e\u578b \u4ee5\u4e0bURL\u304b\u3089\u57fa\u672c\u7684\u306a\u6f14\u7b97\u3067\u3088\u304f\u4f7f\u7528\u3059\u308b\u3082\u306e\u3092\u629c\u7c8b\u3057\u307e\u3057\u305f\u3002 https:\/\/docs.scipy.org\/doc\/numpy-dev\/...<\/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\/1234"}],"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=1234"}],"version-history":[{"count":3,"href":"https:\/\/www.python.ambitious-engineer.com\/wp-json\/wp\/v2\/posts\/1234\/revisions"}],"predecessor-version":[{"id":1256,"href":"https:\/\/www.python.ambitious-engineer.com\/wp-json\/wp\/v2\/posts\/1234\/revisions\/1256"}],"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=1234"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.python.ambitious-engineer.com\/wp-json\/wp\/v2\/categories?post=1234"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.python.ambitious-engineer.com\/wp-json\/wp\/v2\/tags?post=1234"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}