JSLを使用した行と列によるデータテーブルの一部の更新こんにちは、申し訳ありませんが、私は何時間もグーグルをしていて、どうしたらいいのかわかりません。 頑張っていきますが、どうやって質問を立てたらいいのかわからないのですが、本当に腹立たしくて、ついにこんなに単純なことがこんなに複雑になってしまいます。 結局のところ、JMPはあるものを対象としており、他のものを対象としていないことがわかります。 Pythonでは、これは私にとって非常に簡単です。 しかし、私はそれがすべて経験についてだと思います。 けがに侮辱を加えないでください。
データテーブルのサブセットを新しいデータに置き換えたいと思います。 ターゲット行とターゲット列、古いテーブルと新しいデータがあります。 これを行うための構文は何ですか?
ありがとうございました。
マイケル
データ表スクリプティングRe:JSLを使用して行と列でデータテーブルの一部を更新するあるテーブルのデータを別のテーブルの値で更新する3つの方法を次に示します。
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" ) << 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];Re:JSLを使用して行と列でデータテーブルの一部を更新するこんにちはマイケル、
テーブル操作で一般的に使用される構文を説明するために、何ヶ月も前に作成したスクリプトを添付しました。 チェックアウトするときは、ログをオンにして結果を確認し、各行を一度に1つずつ実行します。 順序が狂うと、以前に実行されたコードに依存することがあるため、正しく機能しない可能性があります。
特定のケースでは、添え字を使用してテーブルの内容を置き換えることができます...このスクリプトを見て、行ごとに実行してください
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] = .;