{"id":1031,"date":"2017-12-03T15:54:47","date_gmt":"2017-12-03T20:54:47","guid":{"rendered":"http:\/\/bluegalaxy.info\/codewalk\/?p=1031"},"modified":"2021-01-17T21:08:30","modified_gmt":"2021-01-18T02:08:30","slug":"data-mining-tools-row-to-array","status":"publish","type":"post","link":"https:\/\/bluegalaxy.info\/codewalk\/2017\/12\/03\/data-mining-tools-row-to-array\/","title":{"rendered":"Data Mining Tools: Row to Array"},"content":{"rendered":"<p>This article is the second in a series of articles about data mining tools written in Python CGI that make common data mining tasks faster and easier. The first article in the series can be seen here:<\/p>\n<blockquote class=\"wp-embedded-content\" data-secret=\"vLKOZpVvic\"><p><a href=\"http:\/\/bluegalaxy.info\/codewalk\/2017\/12\/02\/data-mining-tools-column-to-array\/\">Data Mining Tools: Column to Array<\/a><\/p><\/blockquote>\n<p><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" title=\"&#8220;Data Mining Tools: Column to Array&#8221; &#8212; Chris Nielsen Code Walk\" src=\"http:\/\/bluegalaxy.info\/codewalk\/2017\/12\/02\/data-mining-tools-column-to-array\/embed\/#?secret=vLKOZpVvic\" data-secret=\"vLKOZpVvic\" width=\"600\" height=\"338\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe><\/p>\n<p>This tool is very similar to the previous tool, except it is made for copying and pasting a <strong><em>row <\/em><\/strong>of spreadsheet data instead of a column of spreadsheet data. Instead of having to parse spreadsheets from within your script, all you have to do is select a row of data in the spreadsheet , then copy and paste the data into the web form. With the click of a button, the script will produce a Pythonic list (array) that can be copied into your script.<\/p>\n<p>The full screen version of this tool can be seen here:<br \/>\n<a href=\"http:\/\/bluegalaxy.info\/cgi-bin\/row_to_array.py\">https:\/\/bluegalaxy.info\/cgi-bin\/row_to_array.py<\/a><\/p>\n<p>This tool required a slight difference in parsing logic from the column_to_array.py script. In this case, I just needed to split the row string on the tab <code class=\"EnlighterJSRAW\" data-enlighter-language=\"no-highlight\">'\\t'<\/code>character. For example:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\"># Convert the row into an array using split\ns = s.split(\"\\t\")<\/pre>\n<p>Here is the tool, loaded into an iframe:<\/p>\n\n<!-- iframe plugin v.5.2 wordpress.org\/plugins\/iframe\/ -->\n<iframe loading=\"lazy\" src=\"https:\/\/bluegalaxy.info\/cgi-bin\/row_to_array.py\" width=\"100%\" height=\"1000\" frameborder=\"1\" scrolling=\"yes\" id=\"iframe_drop_shadow\" class=\"iframe-class\"><\/iframe>\n\n","protected":false},"excerpt":{"rendered":"<p>This article is the second in a series of articles about data mining tools written in Python CGI that make common data mining tasks faster and easier. The first article in the series can be seen here: Data Mining Tools: Column to Array This tool is very similar to the previous tool, except it is &hellip; <a href=\"https:\/\/bluegalaxy.info\/codewalk\/2017\/12\/03\/data-mining-tools-row-to-array\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Data Mining Tools: Row to Array<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[73,22],"tags":[16,4],"class_list":["post-1031","post","type-post","status-publish","format-standard","hentry","category-data-mining-tools-python-cgi","category-python-language","tag-cgi","tag-python"],"_links":{"self":[{"href":"https:\/\/bluegalaxy.info\/codewalk\/wp-json\/wp\/v2\/posts\/1031","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bluegalaxy.info\/codewalk\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bluegalaxy.info\/codewalk\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bluegalaxy.info\/codewalk\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/bluegalaxy.info\/codewalk\/wp-json\/wp\/v2\/comments?post=1031"}],"version-history":[{"count":4,"href":"https:\/\/bluegalaxy.info\/codewalk\/wp-json\/wp\/v2\/posts\/1031\/revisions"}],"predecessor-version":[{"id":3353,"href":"https:\/\/bluegalaxy.info\/codewalk\/wp-json\/wp\/v2\/posts\/1031\/revisions\/3353"}],"wp:attachment":[{"href":"https:\/\/bluegalaxy.info\/codewalk\/wp-json\/wp\/v2\/media?parent=1031"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bluegalaxy.info\/codewalk\/wp-json\/wp\/v2\/categories?post=1031"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bluegalaxy.info\/codewalk\/wp-json\/wp\/v2\/tags?post=1031"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}