cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Learn how to build custom Python data connectors and further customize JMP’s Data Connector Framework with the Python Data Connector Demo, available now in the JMP Marketplace!
  • See how to create experiments to support product design and ID useful product features. Register for June 12 webinar, 2pm US Eastern Time.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
Ohad_s
Level III

script to subset selected rows

Hi,

I have the following script:

I Want to select some rows and subset them.

selection finds 369 rows, but subset only 140 rows.

Does someone have any idea what I am missing?

 

dt = Current Data Table();
Column(dt, "DieX") << data type(Numeric) << Modeling Type(Continuous) << Format(Best, 12);
Column(dt, "DieY") << data type(Numeric) << Modeling Type(Continuous) << Format(Best, 12);
dt << select where(
	1045 <= :DieX <= 1055 & 1221 <= :DieY <= 1228 
	| 1145 <= :DieX <= 1155 & 1221 <= :DieY <= 1228 
	| 1045 <= :DieX <= 1055 & 770 <= :DieY <= 778 
	| 1145 <= :DieX <= 1155 & 770 <= :DieY <= 778
);
dt_subset = dt << subset(output table("Defects"), selected rows(1));
1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: script to subset selected rows

For me it seems to subset correct amount of rows (369) (I made slight modifications to your script, but even the original did subset correct amount of rows)

Names Default To Here(1);

dt = Open("$DOWNLOADS/Setup2_0_2_Surface.jmp");
dt << clear select << Clear Column Selection;

Column(dt, "DieX") << data type(Numeric) << Modeling Type(Continuous) << Format(Best, 12);
Column(dt, "DieY") << data type(Numeric) << Modeling Type(Continuous) << Format(Best, 12);
dt << select where(
	1045 <= :DieX <= 1055 & 1221 <= :DieY <= 1228 
	| 1145 <= :DieX <= 1155 & 1221 <= :DieY <= 1228 
	| 1045 <= :DieX <= 1055 & 770 <= :DieY <= 778 
	| 1145 <= :DieX <= 1155 & 770 <= :DieY <= 778
);
dt_subset = dt << subset(output table("Defects"), selected rows(1), Selected Columns(0));
-Jarmo

View solution in original post

2 REPLIES 2
jthi
Super User

Re: script to subset selected rows

For me it seems to subset correct amount of rows (369) (I made slight modifications to your script, but even the original did subset correct amount of rows)

Names Default To Here(1);

dt = Open("$DOWNLOADS/Setup2_0_2_Surface.jmp");
dt << clear select << Clear Column Selection;

Column(dt, "DieX") << data type(Numeric) << Modeling Type(Continuous) << Format(Best, 12);
Column(dt, "DieY") << data type(Numeric) << Modeling Type(Continuous) << Format(Best, 12);
dt << select where(
	1045 <= :DieX <= 1055 & 1221 <= :DieY <= 1228 
	| 1145 <= :DieX <= 1155 & 1221 <= :DieY <= 1228 
	| 1045 <= :DieX <= 1055 & 770 <= :DieY <= 778 
	| 1145 <= :DieX <= 1155 & 770 <= :DieY <= 778
);
dt_subset = dt << subset(output table("Defects"), selected rows(1), Selected Columns(0));
-Jarmo
Ohad_s
Level III

Re: script to subset selected rows

Thank you!

 

Recommended Articles