<?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 Python integration get column properties in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Python-integration-get-column-properties/m-p/932220#M108870</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Is there a way to get column properties from JMP data table (such as "Design role" and "Factor changes") in python, if I use df = jmp.current() as a reference to the opened JMP data table?&lt;BR /&gt;I am aware of&amp;nbsp;df[0].dtype and df[0].mtype to get data type and modeling type properties, but I would like to list the factors and responses in python from a DoE generated table.&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;</description>
    <pubDate>Mon, 23 Feb 2026 22:19:38 GMT</pubDate>
    <dc:creator>aatw</dc:creator>
    <dc:date>2026-02-23T22:19:38Z</dc:date>
    <item>
      <title>Python integration get column properties</title>
      <link>https://community.jmp.com/t5/Discussions/Python-integration-get-column-properties/m-p/932220#M108870</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Is there a way to get column properties from JMP data table (such as "Design role" and "Factor changes") in python, if I use df = jmp.current() as a reference to the opened JMP data table?&lt;BR /&gt;I am aware of&amp;nbsp;df[0].dtype and df[0].mtype to get data type and modeling type properties, but I would like to list the factors and responses in python from a DoE generated table.&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 23 Feb 2026 22:19:38 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Python-integration-get-column-properties/m-p/932220#M108870</guid>
      <dc:creator>aatw</dc:creator>
      <dc:date>2026-02-23T22:19:38Z</dc:date>
    </item>
    <item>
      <title>Re: Python integration get column properties</title>
      <link>https://community.jmp.com/t5/Discussions/Python-integration-get-column-properties/m-p/932269#M108873</link>
      <description>&lt;P&gt;You can always fallback to run_jsl if some feature hasn't yet been implemented&lt;/P&gt;</description>
      <pubDate>Tue, 24 Feb 2026 06:24:22 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Python-integration-get-column-properties/m-p/932269#M108873</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2026-02-24T06:24:22Z</dc:date>
    </item>
    <item>
      <title>Re: Python integration get column properties</title>
      <link>https://community.jmp.com/t5/Discussions/Python-integration-get-column-properties/m-p/932443#M108897</link>
      <description>&lt;P&gt;Sure, however the following code:&lt;/P&gt;
&lt;PRE&gt;df = jmp.current()
sc = jmp.run_jsl('df &amp;lt;&amp;lt; Get Column Names();')
print(sc)&lt;/PRE&gt;
&lt;P&gt;returns the following error: Name Unresolved: df in access or evaluation of 'df' , df/*###*/&lt;/P&gt;
&lt;P&gt;Any ideas?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Feb 2026 20:47:10 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Python-integration-get-column-properties/m-p/932443#M108897</guid>
      <dc:creator>aatw</dc:creator>
      <dc:date>2026-02-24T20:47:10Z</dc:date>
    </item>
    <item>
      <title>Re: Python integration get column properties</title>
      <link>https://community.jmp.com/t5/Discussions/Python-integration-get-column-properties/m-p/932447#M108898</link>
      <description>&lt;P&gt;JMP side doesn't know about your df python variables unless you "share" them. No idea what is preferred method, but you can for example use jmp.here&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;import jmp

dt = jmp.open(jmp.SAMPLE_DATA + 'Big Class.jmp')

jmp.here["dt"] = dt

jmp.run_jsl('''
	Names Default To Here(1);
	p = Column(dt, "name") &amp;lt;&amp;lt; Get Property("Notes");	
'''
);

print(jmp.here.get('p'))&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Or you could use Python Get from JMP side of things&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;import jmp

dt = jmp.open(jmp.SAMPLE_DATA + 'Big Class.jmp')

jmp.run_jsl('''
	dtref = Python Get(dt);
	p1 = Column(dtref, "name") &amp;lt;&amp;lt; Get Property("Notes");	
'''
);

print(jmp.here.get('p1'))&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Feb 2026 21:07:06 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Python-integration-get-column-properties/m-p/932447#M108898</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2026-02-24T21:07:06Z</dc:date>
    </item>
    <item>
      <title>Re: Python integration get column properties</title>
      <link>https://community.jmp.com/t5/Discussions/Python-integration-get-column-properties/m-p/932451#M108899</link>
      <description>&lt;P&gt;Very useful, thanks. Although when running:&lt;/P&gt;
&lt;PRE&gt;df = jmp.current()
jmp.run_jsl('''
dt = Python Get( df );
cname = dt &amp;lt;&amp;lt; Get Column Names();
''')
print(jmp.here.get('cname'))&lt;/PRE&gt;
&lt;P&gt;I get "None" as output, despite obviously having some columns in my table.&lt;/P&gt;
&lt;P&gt;Also, if using the script with "Names Default To Here(1)", my JMP crashes...&lt;/P&gt;</description>
      <pubDate>Tue, 24 Feb 2026 21:27:01 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Python-integration-get-column-properties/m-p/932451#M108899</guid>
      <dc:creator>aatw</dc:creator>
      <dc:date>2026-02-24T21:27:01Z</dc:date>
    </item>
    <item>
      <title>Re: Python integration get column properties</title>
      <link>https://community.jmp.com/t5/Discussions/Python-integration-get-column-properties/m-p/932457#M108900</link>
      <description>&lt;P&gt;You get None because you don't have access to here namespace. You can use Python Send&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;import jmp

jmp.open(jmp.SAMPLE_DATA + 'Big Class.jmp')

df = jmp.current()
jmp.run_jsl('''
dt = Python Get(df);
cname = dt &amp;lt;&amp;lt; Get Column Names("string");
Python Send(cname);
''')

print(cname) # ['name', 'age', 'sex', 'height', 'weight']
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 24 Feb 2026 22:00:12 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Python-integration-get-column-properties/m-p/932457#M108900</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2026-02-24T22:00:12Z</dc:date>
    </item>
    <item>
      <title>Re: Python integration get column properties</title>
      <link>https://community.jmp.com/t5/Discussions/Python-integration-get-column-properties/m-p/932487#M108904</link>
      <description>&lt;P&gt;Many thanks jthi!&lt;BR /&gt;This works, not only due to using Python Send (because I tried that before), but also due to specifying "string" type for cname.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Feb 2026 08:04:44 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Python-integration-get-column-properties/m-p/932487#M108904</guid>
      <dc:creator>aatw</dc:creator>
      <dc:date>2026-02-25T08:04:44Z</dc:date>
    </item>
    <item>
      <title>Re: Python integration get column properties</title>
      <link>https://community.jmp.com/t5/Discussions/Python-integration-get-column-properties/m-p/932497#M108907</link>
      <description>&lt;P&gt;Another question/wish: how would one scroll through all columns and check whether they have a "Design Role" or "Factor Changes" property, and list only those columns?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Feb 2026 09:30:42 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Python-integration-get-column-properties/m-p/932497#M108907</guid>
      <dc:creator>aatw</dc:creator>
      <dc:date>2026-02-25T09:30:42Z</dc:date>
    </item>
    <item>
      <title>Re: Python integration get column properties</title>
      <link>https://community.jmp.com/t5/Discussions/Python-integration-get-column-properties/m-p/932502#M108909</link>
      <description>&lt;P&gt;Do you want the result in Python list if one of those properties is found for the columns?&lt;/P&gt;</description>
      <pubDate>Wed, 25 Feb 2026 09:45:11 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Python-integration-get-column-properties/m-p/932502#M108909</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2026-02-25T09:45:11Z</dc:date>
    </item>
    <item>
      <title>Re: Python integration get column properties</title>
      <link>https://community.jmp.com/t5/Discussions/Python-integration-get-column-properties/m-p/932506#M108911</link>
      <description>&lt;P&gt;Yes&lt;/P&gt;</description>
      <pubDate>Wed, 25 Feb 2026 09:55:06 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Python-integration-get-column-properties/m-p/932506#M108911</guid>
      <dc:creator>aatw</dc:creator>
      <dc:date>2026-02-25T09:55:06Z</dc:date>
    </item>
    <item>
      <title>Re: Python integration get column properties</title>
      <link>https://community.jmp.com/t5/Discussions/Python-integration-get-column-properties/m-p/932509#M108913</link>
      <description>&lt;P&gt;Modify the logic as needed to make it easier to understand&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;import jmp

# demo setup
jmp.open(jmp.SAMPLE_DATA + 'Big Class.jmp')
jmp.run_jsl('''
Data Table("Big Class"):weight &amp;lt;&amp;lt; Set Property("Design Role", Design Role("Continuous"));
Data Table("Big Class"):name &amp;lt;&amp;lt; Set Property("Factor Changes", Easy);
''')


df = jmp.current()
jmp.run_jsl('''
dt = Python Get(df);
colnames = dt &amp;lt;&amp;lt; Get Column Names("string");
res = Filter Each({colname}, colnames,
	!Is Empty(Column(dt, colname) &amp;lt;&amp;lt; Get Property("Design Role")) | !Is Empty(Column(dt, colname) &amp;lt;&amp;lt; Get Property("Factor Changes"));
);
Python Send(res);
''')

print(res) # ['name', 'weight']&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Feb 2026 10:44:24 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Python-integration-get-column-properties/m-p/932509#M108913</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2026-02-25T10:44:24Z</dc:date>
    </item>
    <item>
      <title>Re: Python integration get column properties</title>
      <link>https://community.jmp.com/t5/Discussions/Python-integration-get-column-properties/m-p/933357#M108969</link>
      <description>&lt;P&gt;While a data table is accessible from Python and JSL, df in the script above is the variable in the Python environment holding a pointer to the data table. &amp;nbsp;JSL knows nothing about the variable df unless you get do a Python Get(df); from JSL, that makes a JSL variable that references the same data table that df references. &amp;nbsp;While there is no Get Column Names() from the Python side, you need to think in Python instead of JSL. &amp;nbsp;each column in the table has a name property see the Scripting Index.&lt;/P&gt;
&lt;DIV&gt;
&lt;PRE&gt;&lt;SPAN&gt;import jmp&lt;BR /&gt;&lt;/SPAN&gt;dt = jmp.&lt;SPAN&gt;open&lt;/SPAN&gt;(jmp.&lt;SPAN&gt;SAMPLE_DATA + "Big Class.jmp")&lt;BR /&gt;# print then set the first column's name from python&lt;BR /&gt;# note the column index is zero-based just like Python.&lt;BR /&gt;# You can also access the column by name:  print(dt['age'])&lt;BR /&gt;print(dt&lt;/SPAN&gt;[&lt;SPAN&gt;0&lt;/SPAN&gt;].&lt;SPAN&gt;name&lt;/SPAN&gt;)&lt;BR /&gt;dt[&lt;SPAN&gt;0&lt;/SPAN&gt;].&lt;SPAN&gt;name = 'First Name'&lt;BR /&gt;&lt;BR /&gt;# simple list comprehension to walk data table columns&lt;BR /&gt;# and build a list of names from the column's name property&lt;BR /&gt;names = [x&lt;/SPAN&gt;.&lt;SPAN&gt;name for x in dt]&lt;BR /&gt;print(names)&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;/DIV&gt;
&lt;P&gt;A JMP data table behaves as a list of columns and the columns behave as a list of rows. &amp;nbsp;There is a wealth of information in the Python category of the scripting index. &amp;nbsp;The above support has been in place since 18.0.0. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;The design principle of the Python support is to behave the way a Python programmer would expect and there is rich support, especially in the jmp.DataTable object for doing things in a 'Pythonic' way.&lt;/P&gt;</description>
      <pubDate>Mon, 02 Mar 2026 16:30:40 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Python-integration-get-column-properties/m-p/933357#M108969</guid>
      <dc:creator>Paul_Nelson</dc:creator>
      <dc:date>2026-03-02T16:30:40Z</dc:date>
    </item>
    <item>
      <title>Re: Python integration get column properties</title>
      <link>https://community.jmp.com/t5/Discussions/Python-integration-get-column-properties/m-p/933371#M108972</link>
      <description>&lt;P&gt;Regarding:&lt;/P&gt;
&lt;PRE&gt;df = jmp.current()
jmp.run_jsl('''
dt = Python Get( df );
cname = dt &amp;lt;&amp;lt; Get Column Names();
''')
print(jmp.here.get('cname'))&lt;/PRE&gt;
&lt;P&gt;There are a couple issues with the above script. &amp;nbsp;The variable cname is not in the here namespace but rather global namespace because there is not a Names Default to Here(1); in the jmp.run_jsl( ) script. &amp;nbsp;So it defaults to the globals namespace. &amp;nbsp;Second you do need the "Strings" parameter to the &amp;lt;&amp;lt; Get Column Names("Strings") to be able pass the correct list to Python with a Python Send(cname) as been referenced by other responses. &amp;nbsp;By getting cname as a list of strings also allows getting it from the Python side using the here or globals accessors in JMP 19 and beyond. &amp;nbsp;Without making the list a list of strings you get a list of Opaque internal objects instead of strings.&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)
dt[0].name = 'First Name'

# do it in a python way
names = [x.name for x in dt]
print(names)

# using JSL
jmp.run_jsl('''
Names default to here(1);
dt = Python Get( dt );
jname = dt &amp;lt;&amp;lt; Get Column Names("String");
''')
print(jmp.here['jname'])
print(jmp.here.get('jname'))&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 02 Mar 2026 18:45:37 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Python-integration-get-column-properties/m-p/933371#M108972</guid>
      <dc:creator>Paul_Nelson</dc:creator>
      <dc:date>2026-03-02T18:45:37Z</dc:date>
    </item>
  </channel>
</rss>

