{"id":2160,"date":"2015-08-28T21:59:01","date_gmt":"2015-08-28T19:59:01","guid":{"rendered":"http:\/\/www.itersdesktop.com\/?p=2160"},"modified":"2015-10-11T10:24:00","modified_gmt":"2015-10-11T08:24:00","slug":"delete-columns-in-numpy-array","status":"publish","type":"post","link":"https:\/\/www.itersdesktop.com\/vi\/2015\/08\/28\/delete-columns-in-numpy-array\/","title":{"rendered":"X\u00f3a c\u1ed9t trong ma tr\u1eadn v\u1edbi numpy.array"},"content":{"rendered":"<p><\/p>\n<pre class=\"lang:python decode:true \">a=array([[ 0, 1, 2, 3], [ 4, 5, 6, 7], [ 8, 9, 10, 11], [12, 13, 14, 15]])\r\ndelete(a, s_[1:3], axis=0) # remove rows 1 and 2<\/pre>\n<p>output: array([[ 0, 1, 2, 3], [12, 13, 14, 15]])<\/p>\n<figure id=\"attachment_2202\" aria-describedby=\"caption-attachment-2202\" style=\"width: 620px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"size-large wp-image-2202\" src=\"http:\/\/www.itersdesktop.com\/wp-content\/uploads\/2015\/08\/2dimmatrix-deletecolumns-1024x656.png\" alt=\"delete columns in matrix with numpy.array\" width=\"620\" height=\"397\" srcset=\"https:\/\/www.itersdesktop.com\/wp-content\/uploads\/2015\/08\/2dimmatrix-deletecolumns-1024x656.png 1024w, https:\/\/www.itersdesktop.com\/wp-content\/uploads\/2015\/08\/2dimmatrix-deletecolumns-300x192.png 300w, https:\/\/www.itersdesktop.com\/wp-content\/uploads\/2015\/08\/2dimmatrix-deletecolumns-50x32.png 50w, https:\/\/www.itersdesktop.com\/wp-content\/uploads\/2015\/08\/2dimmatrix-deletecolumns.png 2046w\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" \/><figcaption id=\"caption-attachment-2202\" class=\"wp-caption-text\">delete columns in matrix with numpy.array<\/figcaption><\/figure>\n<pre class=\"lang:python decode:true \">delete(a, s_[1:3], axis=1) # remove columns 1 and 2<\/pre>\n<p>output: array([[ 0, 3], [ 4, 7], [ 8, 11], [12, 15]])<\/p>\n<p>Solution was found here: http:\/\/stackoverflow.com\/questions\/1642730\/how-to-delete-columns-in-numpy-array<\/p>\n<p><\/p>","protected":false},"excerpt":{"rendered":"<p>a=array([[ 0, 1, 2, 3], [ 4, 5, 6, 7], [ 8, 9, 10, 11], [12, 13, 14, 15]]) delete(a, s_[1:3], axis=0) # remove rows 1 and 2 output: array([[&hellip; <\/p>\n","protected":false},"author":2,"featured_media":2202,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,122],"tags":[562,563],"class_list":["post-2160","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-programming-languages","category-python","tag-how-to-delete-columns-in-numpy-array-with-python","tag-xoa-cot-trong-mang-dung-numpy"],"_links":{"self":[{"href":"https:\/\/www.itersdesktop.com\/vi\/wp-json\/wp\/v2\/posts\/2160","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.itersdesktop.com\/vi\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.itersdesktop.com\/vi\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.itersdesktop.com\/vi\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.itersdesktop.com\/vi\/wp-json\/wp\/v2\/comments?post=2160"}],"version-history":[{"count":4,"href":"https:\/\/www.itersdesktop.com\/vi\/wp-json\/wp\/v2\/posts\/2160\/revisions"}],"predecessor-version":[{"id":2228,"href":"https:\/\/www.itersdesktop.com\/vi\/wp-json\/wp\/v2\/posts\/2160\/revisions\/2228"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.itersdesktop.com\/vi\/wp-json\/wp\/v2\/media\/2202"}],"wp:attachment":[{"href":"https:\/\/www.itersdesktop.com\/vi\/wp-json\/wp\/v2\/media?parent=2160"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.itersdesktop.com\/vi\/wp-json\/wp\/v2\/categories?post=2160"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.itersdesktop.com\/vi\/wp-json\/wp\/v2\/tags?post=2160"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}