<?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 Updating Part of a Data Table by Row and Column Using JSL in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Updating-Part-of-a-Data-Table-by-Row-and-Column-Using-JSL/m-p/386007#M63613</link>
    <description>&lt;P&gt;Hi, sorry, I've been Googling for hours now and I just don't know what to do. I don't know how to formulate my question though I will try my best, it's just, really exasperating and getting to me now, finally, how such a simple thing can be so complicated. I see that JMP is intended for some things and not others, after all. In Python this would be very easy for me. But I guess it's all about experience. Not to add insult to injury.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wish to replace a subset of my data table with new data. I have the target rows and target column and the old table and the new data. What is the syntax to do this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;Michael&lt;/P&gt;</description>
    <pubDate>Sat, 10 Jun 2023 23:30:20 GMT</pubDate>
    <dc:creator>mostarr</dc:creator>
    <dc:date>2023-06-10T23:30:20Z</dc:date>
    <item>
      <title>Updating Part of a Data Table by Row and Column Using JSL</title>
      <link>https://community.jmp.com/t5/Discussions/Updating-Part-of-a-Data-Table-by-Row-and-Column-Using-JSL/m-p/386007#M63613</link>
      <description>&lt;P&gt;Hi, sorry, I've been Googling for hours now and I just don't know what to do. I don't know how to formulate my question though I will try my best, it's just, really exasperating and getting to me now, finally, how such a simple thing can be so complicated. I see that JMP is intended for some things and not others, after all. In Python this would be very easy for me. But I guess it's all about experience. Not to add insult to injury.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wish to replace a subset of my data table with new data. I have the target rows and target column and the old table and the new data. What is the syntax to do this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;Michael&lt;/P&gt;</description>
      <pubDate>Sat, 10 Jun 2023 23:30:20 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Updating-Part-of-a-Data-Table-by-Row-and-Column-Using-JSL/m-p/386007#M63613</guid>
      <dc:creator>mostarr</dc:creator>
      <dc:date>2023-06-10T23:30:20Z</dc:date>
    </item>
    <item>
      <title>Re: Updating Part of a Data Table by Row and Column Using JSL</title>
      <link>https://community.jmp.com/t5/Discussions/Updating-Part-of-a-Data-Table-by-Row-and-Column-Using-JSL/m-p/386075#M63619</link>
      <description>&lt;P&gt;Here are 3 ways to update data in one table, with values from another table.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );

// Open Data Table: big class.jmp
// → Data Table( "big class" )
Open( "$SAMPLE_DATA/big class.jmp" );

// Create a table with values to be input
// into the big class table
New Table( "Using Update",
	New Column( "Name", character, values( {"JANE", "TIM", "ALICE"} ) ),
	New Column( "Height", values( {58, 69, 64} ) ),
	New Column( "Weight", values( {88, 100, 120} ) )
);

// Wait for a short time to be able to see the two
// data tables before combining them
Wait( 5 );

// Update data tables
Data Table( "big class" ) &amp;lt;&amp;lt; Update( With( Data Table( "Using Update" ) ), Match Columns( :name = :Name ) );

// Update a block of data into the data table
// Create a table to get values from
New Table( "Just Data",
	New Column( "A", values( {100, 101, 102, 103} ) ),
	New Column( "B", values( {90, 91, 92, 93} ) )
);

// Wait for a short time to be able to see the two
// data tables before combining them
Wait( 5 );

dt = Data Table( "big class" );
dt2 = Data Table( "Just Data" );

dt[3 :: 6, 4 :: 5] = dt2[1 :: 4, 1 :: 2];

// One last simple way to move data
dt:age[2] = dt2:a[4];&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 18 May 2021 00:31:46 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Updating-Part-of-a-Data-Table-by-Row-and-Column-Using-JSL/m-p/386075#M63619</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2021-05-18T00:31:46Z</dc:date>
    </item>
    <item>
      <title>Re: Updating Part of a Data Table by Row and Column Using JSL</title>
      <link>https://community.jmp.com/t5/Discussions/Updating-Part-of-a-Data-Table-by-Row-and-Column-Using-JSL/m-p/386082#M63620</link>
      <description>&lt;P&gt;Hi Michael,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've attached a script I wrote many moons ago to illustrate some commonly-used syntax for table operations. When you're checking it out, turn on your log so you can see results, and run each line one at a time. If you go out of order it may not work properly as sometimes I do things that rely on previously executed code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In your specific case, you can replace table contents using subscripting... have a look at this script, running things line-by-line&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;names default to here(1);

//create a 10x10 table of random integers between 1 and 20
dt = As Table( J( 10, 10, Random Integer( 1, 20 ) ) );

//replace column 1 with fibonacci numbers... note 0th row means ALL rows
//note that ` is the transpose operator. 
dt[0, 1] = (Round( 1 / Sqrt( 5 ) * ((1 + Sqrt( 5 )) / 2) ^ (1 :: 10) ))` ;

//replace a subbloc of the table with numbers 81-100 in a 4x5 shape
dt[3::6, 4::8] = shape(81::100, 4);

//set a subbloc to all zeros
dt[8::10, 2::4] = 0;

//store a cell's value in a variable
x = dt[2,3];

//store a subbloc in a matrix
mat = dt[4::6, 0];

//set the whole table to missing
dt[0,0] = .;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 May 2021 00:43:36 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Updating-Part-of-a-Data-Table-by-Row-and-Column-Using-JSL/m-p/386082#M63620</guid>
      <dc:creator>brady_brady</dc:creator>
      <dc:date>2021-05-18T00:43:36Z</dc:date>
    </item>
  </channel>
</rss>

