<?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: Does python write data from memory to JMP only in a circular form? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Does-python-write-data-from-memory-to-JMP-only-in-a-circular/m-p/798485#M97431</link>
    <description>&lt;P&gt;Quickly checking from scripting index it looks like that would be the easiest option.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 13 Sep 2024 06:40:37 GMT</pubDate>
    <dc:creator>jthi</dc:creator>
    <dc:date>2024-09-13T06:40:37Z</dc:date>
    <item>
      <title>Does python write data from memory to JMP only in a circular form?</title>
      <link>https://community.jmp.com/t5/Discussions/Does-python-write-data-from-memory-to-JMP-only-in-a-circular/m-p/798184#M97389</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;import jmp;file_path = r"C:\0\test.txt"
data = []
with open(file_path, 'r') as file:
    for line in file:
        row = line.strip().split('\t')
        data.append([float(row[0]), float(row[1])])
dt = jmp.DataTable("New Table", len(data)) 
col_A = dt.new_column('A', jmp.DataType.Numeric)
col_B = dt.new_column('B', jmp.DataType.Numeric)
for i, (a, b) in enumerate(data):
    dt['A'][i] = a
    dt['B'][i] = b&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;&lt;P&gt;Does this form work as in the original JSL code?&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt[0,0] = data[0,0]&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Thanks Experts!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Sep 2024 09:10:21 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Does-python-write-data-from-memory-to-JMP-only-in-a-circular/m-p/798184#M97389</guid>
      <dc:creator>lala</dc:creator>
      <dc:date>2024-09-12T09:10:21Z</dc:date>
    </item>
    <item>
      <title>Re: Does python write data from memory to JMP only in a circular form?</title>
      <link>https://community.jmp.com/t5/Discussions/Does-python-write-data-from-memory-to-JMP-only-in-a-circular/m-p/798185#M97390</link>
      <description>&lt;P&gt;I try it,not word.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;import jmp;file_path = r"C:\0\test.txt"
data = []
with open(file_path, 'r') as file:
    for line in file:
        row = line.strip().split('\t')
        data.append([float(row[0]), float(row[1])])
r=len(data)
print(f"num {b}")
jmp.run_jsl("""
ar=Python Get(date[]);r=Python Get(b);
d2=New Table("test",Add Rows(r),New Column("A"),New Column("B"));
d2[0,0] = ar[0,0]

""")&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 12 Sep 2024 09:11:42 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Does-python-write-data-from-memory-to-JMP-only-in-a-circular/m-p/798185#M97390</guid>
      <dc:creator>lala</dc:creator>
      <dc:date>2024-09-12T09:11:42Z</dc:date>
    </item>
    <item>
      <title>Re: Does python write data from memory to JMP only in a circular form?</title>
      <link>https://community.jmp.com/t5/Discussions/Does-python-write-data-from-memory-to-JMP-only-in-a-circular/m-p/798208#M97395</link>
      <description>&lt;P&gt;&lt;LI-MESSAGE title="Scripters Club Recording: Running Python Code within JSL" uid="767254" url="https://community.jmp.com/t5/JMP-Scripters-Club-Discussions/Scripters-Club-Recording-Running-Python-Code-within-JSL/m-p/767254#U767254" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-forum-thread lia-fa-icon lia-fa-forum lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;, there are examples in your JMP installation folder &lt;EM&gt;\18\Samples\Scripts\Python&lt;/EM&gt; and I think some in scripting guide&amp;nbsp;&lt;A href="https://www.jmp.com/support/help/en/18.0/index.shtml#page/jmp/additional-jsltopython-examples.shtml#" target="_blank"&gt;Additional JSL-to-Python Examples (jmp.com)&lt;/A&gt;. More can be found from many presentations by Paul (I also mention these in my presentation from Scripters Club)&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="https://community.jmp.com/t5/JMPer-Cable/New-in-JMP-18-Python-jmp-DataTable-and-pandas-DataFrame/ba-p/744680" target="_blank"&gt;New in JMP® 18: Python jmp.DataTable and pandas.DataFrame - JMP User Community&lt;/A&gt;&amp;nbsp;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="https://community.jmp.com/t5/Abstracts/JMP-and-Python-The-Next-Step/ev-p/708092" target="_blank"&gt;JMP and Python: The Next Step - JMP User Community&lt;/A&gt;&amp;nbsp;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="https://community.jmp.com/t5/Abstracts/Peaks-Pipes-Presets-Profiles-and-Python-in-JMP-18/ev-p/708889" target="_blank"&gt;Peaks, Pipes, Presets, Profiles, and Python in JMP® 18 - JMP User Community&lt;/A&gt;&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Thu, 12 Sep 2024 10:00:43 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Does-python-write-data-from-memory-to-JMP-only-in-a-circular/m-p/798208#M97395</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-09-12T10:00:43Z</dc:date>
    </item>
    <item>
      <title>Re: Does python write data from memory to JMP only in a circular form?</title>
      <link>https://community.jmp.com/t5/Discussions/Does-python-write-data-from-memory-to-JMP-only-in-a-circular/m-p/798209#M97396</link>
      <description>&lt;P class=""&gt;&lt;SPAN class=""&gt;This loop form of the code I posted is already implemented.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;I'm just wondering if python has this feature&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;dt[0,0] = data[0,0]&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;Experts said that I have seen these content, but my English skills are poor, and programming knowledge is not much.&lt;/SPAN&gt;&lt;SPAN class=""&gt;Still not solved.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;If I had found a way, I wouldn't have spent so much time writing this post.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;So ask the experts if they can help.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Sep 2024 10:47:23 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Does-python-write-data-from-memory-to-JMP-only-in-a-circular/m-p/798209#M97396</guid>
      <dc:creator>lala</dc:creator>
      <dc:date>2024-09-12T10:47:23Z</dc:date>
    </item>
    <item>
      <title>Re: Does python write data from memory to JMP only in a circular form?</title>
      <link>https://community.jmp.com/t5/Discussions/Does-python-write-data-from-memory-to-JMP-only-in-a-circular/m-p/798332#M97411</link>
      <description>&lt;P&gt;Which feature? Data table subscripting and setting all values of data table from matrix? &lt;/P&gt;
&lt;P&gt;You can set all values with run_jsl&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;import jmp

file_path = r"C:\Users\jarmo\Downloads\test(1).txt"
data = []

with open(file_path, 'r') as file:
    for line in file:
        row = line.strip().split('\t')
        data.append([float(row[0]), float(row[1])])

jmp.run_jsl("""
m = Python Get(data);

dt = New Table("test", 
	Add Rows(N Items(m)),
	New Column("A"),
	New Column("B")
);
	
dt[0,0] = m
""")&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 12 Sep 2024 15:58:04 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Does-python-write-data-from-memory-to-JMP-only-in-a-circular/m-p/798332#M97411</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-09-12T15:58:04Z</dc:date>
    </item>
    <item>
      <title>Re: Does python write data from memory to JMP only in a circular form?</title>
      <link>https://community.jmp.com/t5/Discussions/Does-python-write-data-from-memory-to-JMP-only-in-a-circular/m-p/798448#M97424</link>
      <description>&lt;P&gt;Thanks Experts!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE class="language-jsl"&gt;&lt;CODE&gt;dt[0,0] = m&lt;/CODE&gt;&lt;/PRE&gt;&lt;PRE class="language-jsl"&gt;&lt;CODE&gt;d2[0,0] = ar[0,0]&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2024-09-13_06-52-20.png" style="width: 725px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/68212i9062738E2956966A/image-size/large?v=v2&amp;amp;px=999" role="button" title="2024-09-13_06-52-20.png" alt="2024-09-13_06-52-20.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Sep 2024 22:54:04 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Does-python-write-data-from-memory-to-JMP-only-in-a-circular/m-p/798448#M97424</guid>
      <dc:creator>lala</dc:creator>
      <dc:date>2024-09-12T22:54:04Z</dc:date>
    </item>
    <item>
      <title>Re: Does python write data from memory to JMP only in a circular form?</title>
      <link>https://community.jmp.com/t5/Discussions/Does-python-write-data-from-memory-to-JMP-only-in-a-circular/m-p/798462#M97428</link>
      <description>&lt;P class=""&gt;&lt;SPAN class=""&gt;In addition, ask an expert: how to concatenate two JMP tables with the same column names in a python environment?&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;Do also want to call JSL's concatenation code?&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;Thanks!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Sep 2024 06:13:16 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Does-python-write-data-from-memory-to-JMP-only-in-a-circular/m-p/798462#M97428</guid>
      <dc:creator>lala</dc:creator>
      <dc:date>2024-09-13T06:13:16Z</dc:date>
    </item>
    <item>
      <title>Re: Does python write data from memory to JMP only in a circular form?</title>
      <link>https://community.jmp.com/t5/Discussions/Does-python-write-data-from-memory-to-JMP-only-in-a-circular/m-p/798485#M97431</link>
      <description>&lt;P&gt;Quickly checking from scripting index it looks like that would be the easiest option.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Sep 2024 06:40:37 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Does-python-write-data-from-memory-to-JMP-only-in-a-circular/m-p/798485#M97431</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-09-13T06:40:37Z</dc:date>
    </item>
    <item>
      <title>Re: Does python write data from memory to JMP only in a circular form?</title>
      <link>https://community.jmp.com/t5/Discussions/Does-python-write-data-from-memory-to-JMP-only-in-a-circular/m-p/799560#M97543</link>
      <description>&lt;P&gt;Examples of this functionality is in the Scripting Index. &amp;nbsp;It's also basic Python, these objects were designed to behave with the functionality a Python programmer would expect. &amp;nbsp;The data table object's mapping operator [ ] gives you back a column object reference, which can then be iterated across for the row value. &amp;nbsp;The data table mapping can take either the 'name' or the 0 based index. So where i, and j are both integers&lt;/P&gt;
&lt;P&gt;dt[ i ][ j ] is still perfectly valid. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As is the following&lt;/P&gt;
&lt;P&gt;for x in dt:&lt;BR /&gt;&amp;nbsp; x[row] = value&lt;/P&gt;
&lt;P&gt;Here this iterates across dt in order without needing to know either the index or the name of the column.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The key to remember is that the dt object is a collection of columns, and the column is a collection of rows, so the indexing is dt[ column ] [ row ].&lt;/P&gt;
&lt;P&gt;Also len(dt) returns number of columns as does dt.ncols.&lt;/P&gt;
&lt;P&gt;Similarly len( dt[0] ) returns the length of the first column as does dt.nrows since all columns are the same length.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Sep 2024 13:24:35 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Does-python-write-data-from-memory-to-JMP-only-in-a-circular/m-p/799560#M97543</guid>
      <dc:creator>Paul_Nelson</dc:creator>
      <dc:date>2024-09-17T13:24:35Z</dc:date>
    </item>
  </channel>
</rss>

