<?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 Re: Delete columns with same value in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Delete-columns-with-same-value/m-p/306342#M56179</link>
    <description>&lt;P&gt;I'm not sure if I get you Right,&lt;/P&gt;&lt;P&gt;for modelling you can select the columns that you think are important, so there is no Need to delete the column.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You want to delete some rows where a column has the same value?&lt;/P&gt;&lt;P&gt;Below is the Code for it:&lt;/P&gt;&lt;P&gt;Otherwise please describe more in Detail what you Need, an example May be very helpful.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

wait(3);

dt &amp;lt;&amp;lt; Select duplicate rows( Match( :age ) );
dt &amp;lt;&amp;lt; delete rows;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 14 Sep 2020 07:39:46 GMT</pubDate>
    <dc:creator>Georg</dc:creator>
    <dc:date>2020-09-14T07:39:46Z</dc:date>
    <item>
      <title>Delete columns with same value</title>
      <link>https://community.jmp.com/t5/Discussions/Delete-columns-with-same-value/m-p/306304#M56177</link>
      <description>&lt;P&gt;I run into problem when i run my model with some parameters. So i want to do some data cleaning before run the model. Is there a quick way to delete columns with same values? Please advise how to do it with JSL or any other way that may fit?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 23:37:52 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Delete-columns-with-same-value/m-p/306304#M56177</guid>
      <dc:creator>OneNorthJMP</dc:creator>
      <dc:date>2023-06-09T23:37:52Z</dc:date>
    </item>
    <item>
      <title>Re: Delete columns with same value</title>
      <link>https://community.jmp.com/t5/Discussions/Delete-columns-with-same-value/m-p/306342#M56179</link>
      <description>&lt;P&gt;I'm not sure if I get you Right,&lt;/P&gt;&lt;P&gt;for modelling you can select the columns that you think are important, so there is no Need to delete the column.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You want to delete some rows where a column has the same value?&lt;/P&gt;&lt;P&gt;Below is the Code for it:&lt;/P&gt;&lt;P&gt;Otherwise please describe more in Detail what you Need, an example May be very helpful.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

wait(3);

dt &amp;lt;&amp;lt; Select duplicate rows( Match( :age ) );
dt &amp;lt;&amp;lt; delete rows;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Sep 2020 07:39:46 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Delete-columns-with-same-value/m-p/306342#M56179</guid>
      <dc:creator>Georg</dc:creator>
      <dc:date>2020-09-14T07:39:46Z</dc:date>
    </item>
    <item>
      <title>Re: Delete columns with same value</title>
      <link>https://community.jmp.com/t5/Discussions/Delete-columns-with-same-value/m-p/306343#M56180</link>
      <description>I don't want to delete rows. I want to delete columns that have same value.</description>
      <pubDate>Mon, 14 Sep 2020 07:59:18 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Delete-columns-with-same-value/m-p/306343#M56180</guid>
      <dc:creator>OneNorthJMP</dc:creator>
      <dc:date>2020-09-14T07:59:18Z</dc:date>
    </item>
    <item>
      <title>Re: Delete columns with same value</title>
      <link>https://community.jmp.com/t5/Discussions/Delete-columns-with-same-value/m-p/306350#M56184</link>
      <description>&lt;P&gt;This one deletes columns:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

// make some copies of columns
dt &amp;lt;&amp;lt; New Column( "weight_copy", set each value( :weight ) );
dt &amp;lt;&amp;lt; New Column( "height_copy", set each value( :height ) );


to_delete_lst = {};

For( i = 1, i &amp;lt; N Col( dt ), i++,
	For( j = i + 1, j &amp;lt;= N Col( dt ), j++,
		If( (Column( i ) &amp;lt;&amp;lt; get data type) == (Column( j ) &amp;lt;&amp;lt; get data type), 
		// all celles are equal ?
			If( Mean( (Column( i ) &amp;lt;&amp;lt; get values) == (Column( j ) &amp;lt;&amp;lt; get values) ) == 1,
				Print( (Column( i ) &amp;lt;&amp;lt; get name) || " equal to " || (Column( j ) &amp;lt;&amp;lt; get name) );
				insert into(to_delete_lst, j);
			);
		);
	)
);

// show list of equals
Show(to_delete_lst);
wait(3);

dt &amp;lt;&amp;lt; select columns(to_delete_lst);
dt &amp;lt;&amp;lt; delete columns;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 14 Sep 2020 09:29:44 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Delete-columns-with-same-value/m-p/306350#M56184</guid>
      <dc:creator>Georg</dc:creator>
      <dc:date>2020-09-14T09:29:44Z</dc:date>
    </item>
    <item>
      <title>Re: Delete columns with same value</title>
      <link>https://community.jmp.com/t5/Discussions/Delete-columns-with-same-value/m-p/306351#M56185</link>
      <description>Thanks for JSL. But i am not sure it does what i want.</description>
      <pubDate>Mon, 14 Sep 2020 09:45:07 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Delete-columns-with-same-value/m-p/306351#M56185</guid>
      <dc:creator>OneNorthJMP</dc:creator>
      <dc:date>2020-09-14T09:45:07Z</dc:date>
    </item>
    <item>
      <title>Re: Delete columns with same value</title>
      <link>https://community.jmp.com/t5/Discussions/Delete-columns-with-same-value/m-p/306389#M56187</link>
      <description>&lt;P&gt;I'm not sure, too :)&lt;/img&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This means, you Need to be more specific on what you Need.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you simply want to explore the values of a large table, you May want to use the columns viewer&lt;/P&gt;&lt;P&gt;Columns-&amp;gt;Columns viewer&lt;/P&gt;&lt;P&gt;There you easily can compare columns of a large table.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Sep 2020 10:25:36 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Delete-columns-with-same-value/m-p/306389#M56187</guid>
      <dc:creator>Georg</dc:creator>
      <dc:date>2020-09-14T10:25:36Z</dc:date>
    </item>
    <item>
      <title>Re: Delete columns with same value</title>
      <link>https://community.jmp.com/t5/Discussions/Delete-columns-with-same-value/m-p/306731#M56189</link>
      <description>Georg, thanks for the columns viewer idea.&lt;BR /&gt;&lt;BR /&gt;I think i will do that with columns viewer -&amp;gt; Summary -&amp;gt; sort the table by stdev = 0. Then i can remove the columns later.</description>
      <pubDate>Mon, 14 Sep 2020 12:57:03 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Delete-columns-with-same-value/m-p/306731#M56189</guid>
      <dc:creator>OneNorthJMP</dc:creator>
      <dc:date>2020-09-14T12:57:03Z</dc:date>
    </item>
    <item>
      <title>Re: Delete columns with same value</title>
      <link>https://community.jmp.com/t5/Discussions/Delete-columns-with-same-value/m-p/306749#M56190</link>
      <description>&lt;P&gt;Here is a different take on how to do this.&amp;nbsp; It uses RSquare as an indicator of matching data.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Current Data Table();

colNames = dt &amp;lt;&amp;lt; get column names( continuous );

obj = dt &amp;lt;&amp;lt;
Response Screening(
	Y( Eval( colNames ) ),
	X( Eval( colNames ) )
);
dtCalc = obj &amp;lt;&amp;lt; get PValues;

dtCalc &amp;lt;&amp;lt; select where(Round(:RSquare,4) != 1 | :X == :Y );
try( dtCAlc &amp;lt;&amp;lt; delete rows );

dtCompare = dtCalc &amp;lt;&amp;lt; subset( selected rows(0), columns("X","Y"));
close(dtCalc,nosave);

for each row(
	If(:X &amp;gt; :Y,
		hold=:X;
		:X = :Y;
		:Y = hold;
	)
);

dtFinal = dtCompare &amp;lt;&amp;lt; Summary(
	Group( :X, :Y ),
	Freq( "None" ),
	Weight( "None" ),
	Link to original data table( 0 )
);

close( dtCompare, nosave );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 14 Sep 2020 12:58:31 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Delete-columns-with-same-value/m-p/306749#M56190</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-09-14T12:58:31Z</dc:date>
    </item>
    <item>
      <title>Re: Delete columns with same value</title>
      <link>https://community.jmp.com/t5/Discussions/Delete-columns-with-same-value/m-p/306791#M56191</link>
      <description>&lt;P&gt;Hi nelson,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for advice.&amp;nbsp; But the response screening is take way too much processing time and it is not ideal. Running 45s and haven't half way finish processing.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 999px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/26739iFC1AD4BEC8034EB5/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Sep 2020 13:27:28 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Delete-columns-with-same-value/m-p/306791#M56191</guid>
      <dc:creator>OneNorthJMP</dc:creator>
      <dc:date>2020-09-14T13:27:28Z</dc:date>
    </item>
    <item>
      <title>Re: Delete columns with same value</title>
      <link>https://community.jmp.com/t5/Discussions/Delete-columns-with-same-value/m-p/306901#M56199</link>
      <description>Hi,&lt;BR /&gt;Based on this later post, I think we did not understand the statement of "same values"; we interpreted as column 1 = column 2 for each row but I surmise that you mean any column with identical values in each row (i.e. 0 StdDev). Is that correct?&lt;BR /&gt;If it is, I or somebody more experience that I am should be able to provide a relatively short script.&lt;BR /&gt;Best,&lt;BR /&gt;TS</description>
      <pubDate>Mon, 14 Sep 2020 17:46:39 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Delete-columns-with-same-value/m-p/306901#M56199</guid>
      <dc:creator>Thierry_S</dc:creator>
      <dc:date>2020-09-14T17:46:39Z</dc:date>
    </item>
    <item>
      <title>Re: Delete columns with same value</title>
      <link>https://community.jmp.com/t5/Discussions/Delete-columns-with-same-value/m-p/307745#M56212</link>
      <description>&lt;P&gt;When I run this code, it correctly identifies the duplicate cols but doesn't actually delete them.&amp;nbsp; The log shows no errors.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"height equal to height_copy"&lt;BR /&gt;"weight equal to weight_copy"&lt;BR /&gt;to_delete_lst = {7, 6};&lt;BR /&gt;Scriptable[]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am running v13.2.1&lt;/P&gt;</description>
      <pubDate>Mon, 14 Sep 2020 22:55:24 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Delete-columns-with-same-value/m-p/307745#M56212</guid>
      <dc:creator>jimloughlin</dc:creator>
      <dc:date>2020-09-14T22:55:24Z</dc:date>
    </item>
    <item>
      <title>Re: Delete columns with same value</title>
      <link>https://community.jmp.com/t5/Discussions/Delete-columns-with-same-value/m-p/308975#M56310</link>
      <description>&lt;P&gt;Sorry, I cannot answer,&lt;/P&gt;&lt;P&gt;the Code works fine on JMP 15 with Win10 on my Computer,&lt;/P&gt;&lt;P&gt;and the last two steps are quite Basic commands that should have been implemented in JMP 13 already (but I cannot check).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you perform that both steps of&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;select columns 6+7&lt;/LI&gt;&lt;LI&gt;and delete selected&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;separately one after the other? e.g. by marking script line in Editor and Pressing the Play button.&lt;/P&gt;&lt;P&gt;Where exactly is the Problem?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Sep 2020 12:30:06 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Delete-columns-with-same-value/m-p/308975#M56310</guid>
      <dc:creator>Georg</dc:creator>
      <dc:date>2020-09-18T12:30:06Z</dc:date>
    </item>
    <item>
      <title>Re: Delete columns with same value</title>
      <link>https://community.jmp.com/t5/Discussions/Delete-columns-with-same-value/m-p/309125#M56317</link>
      <description>&lt;P&gt;I ran this in JMP 13.2.1 and it works.....all you need to do, is to delete the lines in the code&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt &amp;lt;&amp;lt; select columns(to_delete_lst);
dt &amp;lt;&amp;lt; delete columns;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and replace them with&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt &amp;lt;&amp;lt; delete columns( to_delete_lst);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 18 Sep 2020 15:41:59 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Delete-columns-with-same-value/m-p/309125#M56317</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-09-18T15:41:59Z</dc:date>
    </item>
    <item>
      <title>Re: Delete columns with same value</title>
      <link>https://community.jmp.com/t5/Discussions/Delete-columns-with-same-value/m-p/309390#M56329</link>
      <description>That works !!! Thanx.</description>
      <pubDate>Fri, 18 Sep 2020 20:07:35 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Delete-columns-with-same-value/m-p/309390#M56329</guid>
      <dc:creator>jimloughlin</dc:creator>
      <dc:date>2020-09-18T20:07:35Z</dc:date>
    </item>
    <item>
      <title>Re: Delete columns with same value</title>
      <link>https://community.jmp.com/t5/Discussions/Delete-columns-with-same-value/m-p/309392#M56330</link>
      <description>TXNELSON's post below worked with JMPv13.2.1 .</description>
      <pubDate>Fri, 18 Sep 2020 20:08:21 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Delete-columns-with-same-value/m-p/309392#M56330</guid>
      <dc:creator>jimloughlin</dc:creator>
      <dc:date>2020-09-18T20:08:21Z</dc:date>
    </item>
  </channel>
</rss>

