<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Convert List to Matrix in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Convert-List-to-Matrix/m-p/105971#M38973</link>
    <description>&lt;P&gt;Practically perfect! Question, what happens to the Number Col Box? Does it stay in memory, or is it only created long enough to send the message to?&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;</description>
    <pubDate>Mon, 14 Jan 2019 14:17:53 GMT</pubDate>
    <dc:creator>MarkDayton</dc:creator>
    <dc:date>2019-01-14T14:17:53Z</dc:date>
    <item>
      <title>Convert List to Matrix</title>
      <link>https://community.jmp.com/t5/Discussions/Convert-List-to-Matrix/m-p/105730#M38932</link>
      <description>&lt;P&gt;What is the quickest way to&amp;nbsp;convert a list: {"a", 1, 2, "b"} into a matrix: [. 1 2 .]?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I expect that I can just loop through all of the elements, but I'm hoping there is a quicker way since I will be doing this many thousands of times in my application, with each list containing hundreds of elements.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Jan 2019 18:30:06 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Convert-List-to-Matrix/m-p/105730#M38932</guid>
      <dc:creator>MarkDayton</dc:creator>
      <dc:date>2019-01-11T18:30:06Z</dc:date>
    </item>
    <item>
      <title>Re: Convert List to Matrix</title>
      <link>https://community.jmp.com/t5/Discussions/Convert-List-to-Matrix/m-p/105736#M38935</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/7923"&gt;@MarkDayton&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp; I don't know if using a data table is ok ? if yes, here you go . Since the data table is private, I would expect it to be more than reasonably fast for hundreds of values&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;MyList = {"a", 1, 2, "b"} ; 

dt = New Table("Temp",
		New Column("C",Numeric,values(MyList)),
		"Private"
              );
Mat = dt &amp;lt;&amp;lt; get as matrix; 
Close(dt,"No Save");
Show(Mat);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Jan 2019 21:25:09 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Convert-List-to-Matrix/m-p/105736#M38935</guid>
      <dc:creator>uday_guntupalli</dc:creator>
      <dc:date>2019-01-11T21:25:09Z</dc:date>
    </item>
    <item>
      <title>Re: Convert List to Matrix</title>
      <link>https://community.jmp.com/t5/Discussions/Convert-List-to-Matrix/m-p/105737#M38936</link>
      <description>&lt;P&gt;Thanks, I'll give that a try.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Jan 2019 21:26:11 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Convert-List-to-Matrix/m-p/105737#M38936</guid>
      <dc:creator>MarkDayton</dc:creator>
      <dc:date>2019-01-11T21:26:11Z</dc:date>
    </item>
    <item>
      <title>Re: Convert List to Matrix</title>
      <link>https://community.jmp.com/t5/Discussions/Convert-List-to-Matrix/m-p/105754#M38937</link>
      <description>&lt;P&gt;Looking at your original question, you wanted a matrix of [1,2].&amp;nbsp; I have added in a statement to get rid of the missing values&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;MyList = {"a", 1, 2, "b"} ; 

dt = New Table("Temp",
		New Column("C",Numeric,values(MyList)),
		"Private"
              );
dt &amp;lt;&amp;lt; select where( ismissing(:c)) &amp;lt;&amp;lt; delete rows;
Mat = dt &amp;lt;&amp;lt; get as matrix; 
Close(dt,"No Save");
Show(Mat);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 11 Jan 2019 22:02:45 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Convert-List-to-Matrix/m-p/105754#M38937</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2019-01-11T22:02:45Z</dc:date>
    </item>
    <item>
      <title>Re: Convert List to Matrix</title>
      <link>https://community.jmp.com/t5/Discussions/Convert-List-to-Matrix/m-p/105755#M38938</link>
      <description>&lt;P&gt;Actually I need the missing values. Sometimes a missing value isn't a problem, for example a test is added later on creating additional columns in the dataset. Earlier data isn't out of spec for tests that weren't performed. Unfortunately, sometimes missing data is a problem, test aborts but prior results are in spec. I haven't figured out how to deal with that yet, but I am making progress.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Jan 2019 22:13:37 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Convert-List-to-Matrix/m-p/105755#M38938</guid>
      <dc:creator>MarkDayton</dc:creator>
      <dc:date>2019-01-11T22:13:37Z</dc:date>
    </item>
    <item>
      <title>Re: Convert List to Matrix</title>
      <link>https://community.jmp.com/t5/Discussions/Convert-List-to-Matrix/m-p/105758#M38940</link>
      <description>&lt;P&gt;This is pretty fast:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;MyList = {"a", 1, 2, "b"};
Mat = Number Col Box("", MyList) &amp;lt;&amp;lt; get as matrix;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 12 Jan 2019 00:16:20 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Convert-List-to-Matrix/m-p/105758#M38940</guid>
      <dc:creator>ms</dc:creator>
      <dc:date>2019-01-12T00:16:20Z</dc:date>
    </item>
    <item>
      <title>Re: Convert List to Matrix</title>
      <link>https://community.jmp.com/t5/Discussions/Convert-List-to-Matrix/m-p/105971#M38973</link>
      <description>&lt;P&gt;Practically perfect! Question, what happens to the Number Col Box? Does it stay in memory, or is it only created long enough to send the message to?&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Mon, 14 Jan 2019 14:17:53 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Convert-List-to-Matrix/m-p/105971#M38973</guid>
      <dc:creator>MarkDayton</dc:creator>
      <dc:date>2019-01-14T14:17:53Z</dc:date>
    </item>
    <item>
      <title>Re: Convert List to Matrix</title>
      <link>https://community.jmp.com/t5/Discussions/Convert-List-to-Matrix/m-p/105972#M38974</link>
      <description>&lt;P&gt;To be perfect, I did this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;data = shape(Number Col Box("", dt[1,0]) &amp;lt;&amp;lt; get as matrix, 1, N Cols(dt));&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Now, given similarly constructed matrices for the LSL/USL specs, I can do:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;If( max(data &amp;lt; LSL) &amp;gt; 0 | max(data &amp;gt; USL) &amp;gt; 0, "FAIL", "PASS")&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;to check a row of data against the limits specified in the column properties, without having to loop through the columns for every row - taking a mXn process and turning it into a m+n process.&lt;/P&gt;</description>
      <pubDate>Tue, 18 Feb 2020 14:07:38 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Convert-List-to-Matrix/m-p/105972#M38974</guid>
      <dc:creator>MarkDayton</dc:creator>
      <dc:date>2020-02-18T14:07:38Z</dc:date>
    </item>
    <item>
      <title>Re: Convert List to Matrix</title>
      <link>https://community.jmp.com/t5/Discussions/Convert-List-to-Matrix/m-p/105973#M38975</link>
      <description>&lt;P&gt;Not sure about memory handling here. But since the NumberColBox&amp;nbsp;isn't drawn or stored in a variable I don't think it uses or locks up significant amounts of memory.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It also seems to scale linearly:&amp;nbsp;If looped&amp;nbsp;10000x , 100000x and&amp;nbsp;1000000x it takes&amp;nbsp;0.27, 2.7 and 26.7&amp;nbsp;seconds, respectively. No difference in memory usage.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Applied to this small list, the number col box is about 30 times faster than the data table approach posted above. For very long lists – there may be an upper limit for&amp;nbsp;how many items a NumberColBox can hold – the data table method may be more efficient.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Jan 2019 14:54:02 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Convert-List-to-Matrix/m-p/105973#M38975</guid>
      <dc:creator>ms</dc:creator>
      <dc:date>2019-01-14T14:54:02Z</dc:date>
    </item>
    <item>
      <title>Re: Convert List to Matrix</title>
      <link>https://community.jmp.com/t5/Discussions/Convert-List-to-Matrix/m-p/105974#M38976</link>
      <description>&lt;P&gt;BOOYAH!, Declaring victory and going home! On my data table with 30,000 rows and 150 columns, my routine went from a runtime of 8.5 minutes looping through every column on every row and checking against the limits for that column, to a runtime of 4.5 SECONDS checking a whole row in one shot! As I said, BOOYAH!&lt;/P&gt;</description>
      <pubDate>Mon, 14 Jan 2019 17:09:57 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Convert-List-to-Matrix/m-p/105974#M38976</guid>
      <dc:creator>MarkDayton</dc:creator>
      <dc:date>2019-01-14T17:09:57Z</dc:date>
    </item>
  </channel>
</rss>

