cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Try the Materials Informatics Toolkit, which is designed to easily handle SMILES data. This and other helpful add-ins are available in the JMP® Marketplace
%3CLINGO-SUB%20id%3D%22lingo-sub-773890%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%E6%96%87%E6%9C%AC%E6%A0%BC%E5%BC%8F%E7%9A%84%E5%86%85%E5%AE%B9%E5%A6%82%E4%BD%95%E4%B8%8D%E9%87%8D%E5%A4%8D%E5%9C%B0%E8%BF%9B%E5%85%A5%E5%86%85%E5%AD%98%EF%BC%9F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-773890%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%3CSPAN%3E%E5%B0%B1%E5%83%8F%E7%AC%AC%E4%B8%80%E5%88%97%E8%BF%99%E6%A0%B7%EF%BC%9A%3C%2FSPAN%3E%3C%2FP%3E%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3Edt%20%3D%20Open(%20%22%24SAMPLE_DATA%2FBig%20Class.jmp%22%20)%3B%0Adt%20%26lt%3B%26lt%3B%20Add%20Rows(%201%2C%20after(%20N%20Row(%20dt%20)%20)%20)%3B%0Adt%5BN%20Rows(%20dt%20)%2C%201%5D%20%3D%20dt%5B1%2C%201%5D%3B%0A%0Aar%20%3D%20dt%20%26lt%3B%26lt%3B%20GetAsMatrix(%201%20)%3Bnn%20%3D%20Matrix(%20Associative%20Array(%20ar%5B0%2C%201%5D%20)%20%26lt%3B%26lt%3B%20getKeys%20)%3B%2F%2F%EF%BC%9F%EF%BC%9F%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%3CSPAN%3E%E8%B0%A2%E8%B0%A2%EF%BC%81%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-773890%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CLINGO-LABEL%3E%E5%9F%BA%E7%A1%80%E6%95%B0%E6%8D%AE%E5%88%86%E6%9E%90%E4%B8%8E%E5%BB%BA%E6%A8%A1%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3E%E8%A7%86%E7%AA%97%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-773912%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%E5%9B%9E%E5%A4%8D%EF%BC%9A%E6%96%87%E6%9C%AC%E6%A0%BC%E5%BC%8F%E7%9A%84%E5%86%85%E5%AE%B9%E5%A6%82%E4%BD%95%E4%B8%8D%E9%87%8D%E5%A4%8D%E5%9C%B0%E8%BF%9B%E5%85%A5%E5%86%85%E5%AD%98%EF%BC%9F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-773912%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E4%BD%BF%E7%94%A8%20Summarize()%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3ENames%20Default%20To%20Here(1)%3B%0A%0Adt%20%3D%20Open(%22%24SAMPLE_DATA%2FBig%20Class.jmp%22)%3B%0Adt%20%26lt%3B%26lt%3B%20Add%20Rows(1%2C%20after(N%20Row(dt)))%3B%0Adt%5BN%20Rows(dt)%2C%201%5D%20%3D%20dt%5B1%2C%201%5D%3B%0A%0ASummarize(dt%2C%20uniq%20%3D%20By(Column(dt%2C%201)))%3B%0A%0Ashow(uniq)%3B%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%E6%88%96%E5%85%B3%E8%81%94%E6%95%B0%E7%BB%84()%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3EAssociative%20Array(Column(dt%2C%201))%20%26lt%3B%26lt%3B%20get%20keys%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%E6%88%96%E8%80%85%E5%88%9B%E5%BB%BA%E6%B1%87%E6%80%BB%E8%A1%A8%E5%B9%B6%E4%BB%8E%E4%B8%AD%E8%8E%B7%E5%8F%96%E5%80%BC%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3Edt_summary%20%3D%20dt%20%26lt%3B%26lt%3B%20Summary(%0A%09Group(Column(dt%2C%201))%2C%0A%09Freq(%22None%22)%2C%0A%09Weight(%22None%22)%2C%0A%09Link%20to%20original%20data%20table(0)%2C%0A%09private%0A)%3B%0A%0Aa%20%3D%20dt_summary%5B0%2C%201%5D%3B%0AClose(dt_summary%2C%20No%20save)%3B%0Ashow(a)%3B%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%E6%89%80%E6%9C%89%E8%BF%99%E4%BA%9B%E9%83%BD%E6%9C%89%E8%87%AA%E5%B7%B1%E7%9A%84%E7%94%A8%E4%BE%8B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-774015%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%E5%9B%9E%E5%A4%8D%EF%BC%9A%E6%96%87%E6%9C%AC%E6%A0%BC%E5%BC%8F%E7%9A%84%E5%86%85%E5%AE%B9%E5%A6%82%E4%BD%95%E4%B8%8D%E9%87%8D%E5%A4%8D%E5%9C%B0%E8%BF%9B%E5%85%A5%E5%86%85%E5%AD%98%EF%BC%9F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-774015%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E8%B0%A2%E8%B0%A2%E4%B8%93%E5%AE%B6%EF%BC%81%3C%2FP%3E%3CP%3E%E5%86%85%E5%AD%98%E4%B8%AD%E5%B7%B2%E6%9C%89%E7%9A%84%E5%88%97%E8%A1%A8%E5%8F%AF%E4%BB%A5%E9%80%9A%E8%BF%87%E7%B1%BB%E4%BC%BC%E7%9A%84%E5%87%BD%E6%95%B0%E8%BF%9B%E8%A1%8C%E8%BF%87%E6%BB%A4%E5%90%97%EF%BC%9F%3C%2FP%3E%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3Ea1%3D%7B%22A%22%2C%22B%22%2C%22C%22%2C%22D%22%2C%22E%22%2C%22B%22%2C%22C%22%2C%22D%22%2C%22E%22%7D%3B%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-774020%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%E5%9B%9E%E5%A4%8D%EF%BC%9A%E6%96%87%E6%9C%AC%E6%A0%BC%E5%BC%8F%E7%9A%84%E5%86%85%E5%AE%B9%E5%A6%82%E4%BD%95%E4%B8%8D%E9%87%8D%E5%A4%8D%E5%9C%B0%E8%BF%9B%E5%85%A5%E5%86%85%E5%AD%98%EF%BC%9F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-774020%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E6%89%80%E6%9C%89%E6%96%B9%E6%B3%95%E9%83%BD%E6%9C%89%E6%95%88%EF%BC%8C%E4%BD%86%E5%AF%B9%E4%BA%8E%20summary%2Fsummarize%EF%BC%8C%E6%82%A8%E5%BF%85%E9%A1%BB%E5%85%88%E5%88%9B%E5%BB%BA%E6%95%B0%E6%8D%AE%E8%A1%A8%E3%80%82%E5%AF%B9%E4%BA%8E%E5%85%B3%E8%81%94%E6%95%B0%E7%BB%84%EF%BC%8C%E5%AE%83%E6%9B%B4%E7%AE%80%E5%8D%95%3CA%20href%3D%22https%3A%2F%2Fwww.jmp.com%2Fsupport%2Fhelp%2Fen%2F17.2%2F%23page%2Fjmp%2Fcreate-associative-arrays.shtml%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3E%E8%84%9A%E6%9C%AC%E6%8C%87%E5%8D%97%20%26gt%3B%20%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84%20%26gt%3B%20JSL%20%E8%84%9A%E6%9C%AC%E4%B8%AD%E7%9A%84%E5%85%B3%E8%81%94%E6%95%B0%E7%BB%84%20%26gt%3B%20%E5%88%9B%E5%BB%BA%E5%85%B3%E8%81%94%E6%95%B0%E7%BB%84%3C%2FA%3E%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3ENames%20Default%20To%20Here(1)%3B%0A%0Aa1%20%3D%20%7B%22A%22%2C%20%22B%22%2C%20%22C%22%2C%20%22D%22%2C%20%22E%22%2C%20%22B%22%2C%20%22C%22%2C%20%22D%22%2C%20%22E%22%7D%3B%0A%0Aa2%20%3D%20Associative%20Array(a1)%20%26lt%3B%26lt%3B%20get%20keys%3B%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLINGO-BODY%3E
Choose Language Hide Translation Bar
lala
Level VIII

How does text format content get in memory without repetition?

Like this first column:

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt << Add Rows( 1, after( N Row( dt ) ) );
dt[N Rows( dt ), 1] = dt[1, 1];

ar = dt << GetAsMatrix( 1 );nn = Matrix( Associative Array( ar[0, 1] ) << getKeys );//??

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: How does text format content get in memory without repetition?

Use Summarize()

Names Default To Here(1);

dt = Open("$SAMPLE_DATA/Big Class.jmp");
dt << Add Rows(1, after(N Row(dt)));
dt[N Rows(dt), 1] = dt[1, 1];

Summarize(dt, uniq = By(Column(dt, 1)));

show(uniq);

or associative array()

Associative Array(Column(dt, 1)) << get keys

or create summary table and get values from there

dt_summary = dt << Summary(
	Group(Column(dt, 1)),
	Freq("None"),
	Weight("None"),
	Link to original data table(0),
	private
);

a = dt_summary[0, 1];
Close(dt_summary, No save);
show(a);

All of these have their own use cases

-Jarmo

View solution in original post

3 REPLIES 3
jthi
Super User

Re: How does text format content get in memory without repetition?

Use Summarize()

Names Default To Here(1);

dt = Open("$SAMPLE_DATA/Big Class.jmp");
dt << Add Rows(1, after(N Row(dt)));
dt[N Rows(dt), 1] = dt[1, 1];

Summarize(dt, uniq = By(Column(dt, 1)));

show(uniq);

or associative array()

Associative Array(Column(dt, 1)) << get keys

or create summary table and get values from there

dt_summary = dt << Summary(
	Group(Column(dt, 1)),
	Freq("None"),
	Weight("None"),
	Link to original data table(0),
	private
);

a = dt_summary[0, 1];
Close(dt_summary, No save);
show(a);

All of these have their own use cases

-Jarmo
lala
Level VIII

Re: How does text format content get in memory without repetition?

Thanks Experts!

Can a list already in memory be filtered by a similar function?

a1={"A","B","C","D","E","B","C","D","E"};
jthi
Super User

Re: How does text format content get in memory without repetition?

All of the same methods work, but for summary/summarize you have to first create a data table. For associative array it is more simple Scripting Guide > Data Structures > Associative Arrays in JSL Scripts > Create Associative Arrays 

Names Default To Here(1);

a1 = {"A", "B", "C", "D", "E", "B", "C", "D", "E"};

a2 = Associative Array(a1) << get keys;
-Jarmo