<?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 How to assign a list of values to specific list of rows (without for loop) in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-assign-a-list-of-values-to-specific-list-of-rows-without/m-p/431715#M68146</link>
    <description>&lt;P&gt;Is there a way to assign a list of values to specific rows in a column without for loop ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For instance, is it possible to assign the "new values" in the script below to row 1,5,7 on the Weight column ?&amp;nbsp;&lt;/P&gt;&lt;P&gt;The script below doesn't work. I know one of the way to do this is to use for loop, but I wonder if there are other methods without for loops.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;PRE&gt;dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

index = [1,5,7];
new values = [11,22,33];
dt:weight[index] = new values;&lt;/PRE&gt;&lt;PRE&gt;&lt;CODE class=""&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 09 Jun 2023 18:04:09 GMT</pubDate>
    <dc:creator>Djtjhin</dc:creator>
    <dc:date>2023-06-09T18:04:09Z</dc:date>
    <item>
      <title>How to assign a list of values to specific list of rows (without for loop)</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-assign-a-list-of-values-to-specific-list-of-rows-without/m-p/431715#M68146</link>
      <description>&lt;P&gt;Is there a way to assign a list of values to specific rows in a column without for loop ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For instance, is it possible to assign the "new values" in the script below to row 1,5,7 on the Weight column ?&amp;nbsp;&lt;/P&gt;&lt;P&gt;The script below doesn't work. I know one of the way to do this is to use for loop, but I wonder if there are other methods without for loops.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;PRE&gt;dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

index = [1,5,7];
new values = [11,22,33];
dt:weight[index] = new values;&lt;/PRE&gt;&lt;PRE&gt;&lt;CODE class=""&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 18:04:09 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-assign-a-list-of-values-to-specific-list-of-rows-without/m-p/431715#M68146</guid>
      <dc:creator>Djtjhin</dc:creator>
      <dc:date>2023-06-09T18:04:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to assign a list of values to specific list of rows (without for loop)</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-assign-a-list-of-values-to-specific-list-of-rows-without/m-p/431720#M68147</link>
      <description>&lt;P&gt;No need to loop. This should work:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;Names Default To Here(1);

dt = Open("$SAMPLE_DATA/Big Class.jmp");

index = [1, 5, 7];
new values = [11, 22, 33];
dt[index, "weight"] = new values;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;A href="https://community.jmp.com/t5/Uncharted/Data-table-subscripting/ba-p/21013" target="_blank" rel="noopener"&gt;Used this great source as reference&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 30 Oct 2021 09:35:12 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-assign-a-list-of-values-to-specific-list-of-rows-without/m-p/431720#M68147</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2021-10-30T09:35:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to assign a list of values to specific list of rows (without for loop)</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-assign-a-list-of-values-to-specific-list-of-rows-without/m-p/431842#M68156</link>
      <description>&lt;P&gt;Fantastic&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/14366"&gt;@jthi&lt;/a&gt;&amp;nbsp;!! Learn something new today :)&lt;/img&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Nov 2021 06:37:43 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-assign-a-list-of-values-to-specific-list-of-rows-without/m-p/431842#M68156</guid>
      <dc:creator>Djtjhin</dc:creator>
      <dc:date>2021-11-01T06:37:43Z</dc:date>
    </item>
  </channel>
</rss>

