{"id":340,"date":"2015-03-09T17:53:00","date_gmt":"2015-03-09T15:53:00","guid":{"rendered":"http:\/\/mednis.info\/wp\/?p=340"},"modified":"2015-03-09T17:53:00","modified_gmt":"2015-03-09T15:53:00","slug":"how-to-delete-columns-in-numpy-array","status":"publish","type":"post","link":"http:\/\/mednis.info\/wp\/?p=340","title":{"rendered":"How to delete columns in numpy.array"},"content":{"rendered":"<pre>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<pre>delete(a, s_[1:3], axis=1) # remove columns 1 and 2\r\noutput: array([[ 0, 3], [ 4, 7], [ 8, 11], [12, 15]])<\/pre>\n<p>Solution found here: <a href=\"http:\/\/stackoverflow.com\/questions\/1642730\/how-to-delete-columns-in-numpy-array\" target=\"_blank\">http:\/\/stackoverflow.com\/questions\/1642730\/how-to-delete-columns-in-numpy-array<\/a><\/p>\n","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([[ 0, 1, 2, 3], [12, 13, 14, 15]]) delete(a, s_[1:3], axis=1) # remove columns 1 and 2 output: array([[ 0, 3], [ 4, 7], [ &hellip; <a href=\"http:\/\/mednis.info\/wp\/?p=340\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">How to delete columns in numpy.array<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[39,3],"tags":[],"_links":{"self":[{"href":"http:\/\/mednis.info\/wp\/index.php?rest_route=\/wp\/v2\/posts\/340"}],"collection":[{"href":"http:\/\/mednis.info\/wp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/mednis.info\/wp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/mednis.info\/wp\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/mednis.info\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=340"}],"version-history":[{"count":2,"href":"http:\/\/mednis.info\/wp\/index.php?rest_route=\/wp\/v2\/posts\/340\/revisions"}],"predecessor-version":[{"id":345,"href":"http:\/\/mednis.info\/wp\/index.php?rest_route=\/wp\/v2\/posts\/340\/revisions\/345"}],"wp:attachment":[{"href":"http:\/\/mednis.info\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=340"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/mednis.info\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=340"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/mednis.info\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=340"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}