<?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: JMP18: Python: jmp.Datatable: HowTo get column names without converting to pandas dataframe in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/JMP18-Python-jmp-Datatable-HowTo-get-column-names-without/m-p/762036#M94048</link>
    <description>&lt;P&gt;The data table is an iterable collection of columns.&lt;/P&gt;
&lt;PRE&gt;import jmp
dt = jmp.open(jmp.SAMPLE_DATA + 'Big Class.jmp')
col_names = [ x.name for x in dt]
print(col_names)&lt;/PRE&gt;
&lt;P&gt;Resulting in&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;['name', 'age', 'sex', 'height', 'weight']&lt;/PRE&gt;</description>
    <pubDate>Thu, 30 May 2024 13:19:40 GMT</pubDate>
    <dc:creator>Paul_Nelson</dc:creator>
    <dc:date>2024-05-30T13:19:40Z</dc:date>
    <item>
      <title>JMP18: Python: jmp.Datatable: HowTo get column names without converting to pandas dataframe</title>
      <link>https://community.jmp.com/t5/Discussions/JMP18-Python-jmp-Datatable-HowTo-get-column-names-without/m-p/762015#M94034</link>
      <description>&lt;P&gt;Trying to create a new column in a jmp.Datatable and check if it already exists.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Need to get list of column names&lt;/P&gt;</description>
      <pubDate>Thu, 30 May 2024 02:57:29 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JMP18-Python-jmp-Datatable-HowTo-get-column-names-without/m-p/762015#M94034</guid>
      <dc:creator>minion</dc:creator>
      <dc:date>2024-05-30T02:57:29Z</dc:date>
    </item>
    <item>
      <title>Re: HowTo get column names of jmp.Datatable without converting to pandas dataframe</title>
      <link>https://community.jmp.com/t5/Discussions/JMP18-Python-jmp-Datatable-HowTo-get-column-names-without/m-p/762016#M94035</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;One sample from JSL index&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
n = dt &amp;lt;&amp;lt; Get Column Names();
Show( n );
CNames = dt &amp;lt;&amp;lt; Get Column Names( Continuous );
Show( CNames );
SNames = dt &amp;lt;&amp;lt; Get Column Names( String );
Show( SNames );&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;:)&lt;/img&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 May 2024 01:34:10 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JMP18-Python-jmp-Datatable-HowTo-get-column-names-without/m-p/762016#M94035</guid>
      <dc:creator>frank_wang</dc:creator>
      <dc:date>2024-05-30T01:34:10Z</dc:date>
    </item>
    <item>
      <title>Re: HowTo get column names of jmp.Datatable without converting to pandas dataframe</title>
      <link>https://community.jmp.com/t5/Discussions/JMP18-Python-jmp-Datatable-HowTo-get-column-names-without/m-p/762017#M94036</link>
      <description>&lt;P&gt;Here is the method I normally use to determine if a specific column is or is not in the data table&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = 
// Open Data Table: Big Class.jmp
// → Data Table( "Big Class" )
Open( "$SAMPLE_DATA/Big Class.jmp" );

If( Try( :mycolumn &amp;lt;&amp;lt; get name, "" ) == "",
	New Column( "mycolumn" )
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 30 May 2024 02:28:18 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JMP18-Python-jmp-Datatable-HowTo-get-column-names-without/m-p/762017#M94036</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2024-05-30T02:28:18Z</dc:date>
    </item>
    <item>
      <title>Re: HowTo get column names of jmp.Datatable without converting to pandas dataframe</title>
      <link>https://community.jmp.com/t5/Discussions/JMP18-Python-jmp-Datatable-HowTo-get-column-names-without/m-p/762018#M94037</link>
      <description>&lt;P&gt;Thanks for the inputs.&lt;/P&gt;&lt;P&gt;My bad for not mentioning that was trying to do it in the python environment&lt;/P&gt;&lt;P&gt;Sample code below&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;import jmp
import jmputils

dt = jmp.current() # get current datatable
dt.new_column('colA', jmp.DataType.Character)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Want to check if colA exists before creating a new one&lt;/P&gt;</description>
      <pubDate>Thu, 30 May 2024 02:53:46 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JMP18-Python-jmp-Datatable-HowTo-get-column-names-without/m-p/762018#M94037</guid>
      <dc:creator>minion</dc:creator>
      <dc:date>2024-05-30T02:53:46Z</dc:date>
    </item>
    <item>
      <title>Re: HowTo get column names of jmp.Datatable without converting to pandas dataframe</title>
      <link>https://community.jmp.com/t5/Discussions/JMP18-Python-jmp-Datatable-HowTo-get-column-names-without/m-p/762020#M94038</link>
      <description>&lt;P&gt;You can always fall back to jsl using jmp.run_jsl&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;CNames = jmp.run_jsl('''
Data Table( "Powered by Python" ) &amp;lt;&amp;lt; Get Column Names( Continuous, String );
''')&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Or you could maybe loop over the columns check them with col_obj.name&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;import jmp
dt = jmp.open(jmp.SAMPLE_DATA + "Big Class.jmp")
print(dt[0].name)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Comparing column names might not be that easy in JMP and you might want to use something like &amp;lt;&amp;lt; Has Column with jmp.run_jsl (&lt;A href="https://community.jmp.com/t5/JMP-Wish-List/data-table-message-column-exists-colname/idi-p/573018" target="_blank"&gt;data table : message column exists(colname)? - JMP User Community&lt;/A&gt;)&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_0-1717044361108.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/64629iC34B1747176B9597/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_0-1717044361108.png" alt="jthi_0-1717044361108.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 May 2024 04:46:33 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JMP18-Python-jmp-Datatable-HowTo-get-column-names-without/m-p/762020#M94038</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-05-30T04:46:33Z</dc:date>
    </item>
    <item>
      <title>Re: JMP18: Python: jmp.Datatable: HowTo get column names without converting to pandas dataframe</title>
      <link>https://community.jmp.com/t5/Discussions/JMP18-Python-jmp-Datatable-HowTo-get-column-names-without/m-p/762036#M94048</link>
      <description>&lt;P&gt;The data table is an iterable collection of columns.&lt;/P&gt;
&lt;PRE&gt;import jmp
dt = jmp.open(jmp.SAMPLE_DATA + 'Big Class.jmp')
col_names = [ x.name for x in dt]
print(col_names)&lt;/PRE&gt;
&lt;P&gt;Resulting in&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;['name', 'age', 'sex', 'height', 'weight']&lt;/PRE&gt;</description>
      <pubDate>Thu, 30 May 2024 13:19:40 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JMP18-Python-jmp-Datatable-HowTo-get-column-names-without/m-p/762036#M94048</guid>
      <dc:creator>Paul_Nelson</dc:creator>
      <dc:date>2024-05-30T13:19:40Z</dc:date>
    </item>
    <item>
      <title>Re: JMP18: Python: jmp.Datatable: HowTo get column names without converting to pandas dataframe</title>
      <link>https://community.jmp.com/t5/Discussions/JMP18-Python-jmp-Datatable-HowTo-get-column-names-without/m-p/762037#M94049</link>
      <description>&lt;P&gt;From which it is a simple check to see if the name is in the list.&lt;/P&gt;
&lt;PRE&gt;if 'age' in col_names:
    print('found age')&lt;/PRE&gt;</description>
      <pubDate>Thu, 30 May 2024 13:32:01 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JMP18-Python-jmp-Datatable-HowTo-get-column-names-without/m-p/762037#M94049</guid>
      <dc:creator>Paul_Nelson</dc:creator>
      <dc:date>2024-05-30T13:32:01Z</dc:date>
    </item>
  </channel>
</rss>

