<?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: Retrieving data formatted as a string from Python in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Retrieving-data-formatted-as-a-string-from-Python/m-p/538962#M76007</link>
    <description>&lt;P&gt;Thanks for the suggestion. I'll look into it?&lt;/P&gt;</description>
    <pubDate>Wed, 31 Aug 2022 02:34:51 GMT</pubDate>
    <dc:creator>Sburel</dc:creator>
    <dc:date>2022-08-31T02:34:51Z</dc:date>
    <item>
      <title>Retrieving data formatted as a string from Python</title>
      <link>https://community.jmp.com/t5/Discussions/Retrieving-data-formatted-as-a-string-from-Python/m-p/538945#M76003</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a simple script that sends a variable to Python to run an SQL query ( going through JMP directly somehow is very slow, python is fine).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyway, the query runs fine but I can't figure out how to make use of the data generated by Python and format it into a JMP table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any suggestions would be greatly appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've created a move script which generates the string exactly as produced by a working SQL query in Python.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sebastien&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;names default to here(1);
clear log();
data="STUDY_ID,STUDYID,SPONSOR_REFERENCE_ID,BASAL_DIET,DOSING_END_DATE,DOSING_START_DATE,EXPERIMENTAL_END_DATE,EXPERIMENTAL_START_DATE,FEEDING_REGIMEN,GLP_FLAG,GLP_TYPE,STUDY_END_DATE,STUDY_START_DATE
3713,5500202,P097-17-01,PMI Crt Primate 5048,,,2018-05-11,2017-11-14,BID (twice per day),Y,OECD,2018-09-26,2017-10-20
3728,8482255,HTTsnp-RS01,,,2022-06-23,,2022-05-26,,N,,,2022-05-25
";
python init();

python send(data);

python submit(
"\[
import pandas as pd	
#I can run a SQL query in JMP but for some reasons , the download is very slow and the table to be retrive fairly lage, whereas using Python is very fast so we are trying that option sincethe query is very simple
#in this mock example 'data'is sent to python from JMP but in a real SQL query the data the data is formated as CSV , see below andretrived using python get
#data = df.to_csv(index=False) #retrieve data in csv format
print(data)
]\"
);

getstr = Python Get( data );	//how to convert a string into a table?

	show( getstr);

	Python Term();&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 10 Jun 2023 23:53:39 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Retrieving-data-formatted-as-a-string-from-Python/m-p/538945#M76003</guid>
      <dc:creator>Sburel</dc:creator>
      <dc:date>2023-06-10T23:53:39Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieving data formatted as a string from Python</title>
      <link>https://community.jmp.com/t5/Discussions/Retrieving-data-formatted-as-a-string-from-Python/m-p/538950#M76004</link>
      <description>&lt;P&gt;Is there a reason you are not extracting the data into a Pandas.DataFrame, which can then be directly tranferred into a JMP data table?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;See Extending JMP, Work with Python in the Scripting Guide.&lt;/P&gt;</description>
      <pubDate>Wed, 31 Aug 2022 01:08:16 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Retrieving-data-formatted-as-a-string-from-Python/m-p/538950#M76004</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2022-08-31T01:08:16Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieving data formatted as a string from Python</title>
      <link>https://community.jmp.com/t5/Discussions/Retrieving-data-formatted-as-a-string-from-Python/m-p/538962#M76007</link>
      <description>&lt;P&gt;Thanks for the suggestion. I'll look into it?&lt;/P&gt;</description>
      <pubDate>Wed, 31 Aug 2022 02:34:51 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Retrieving-data-formatted-as-a-string-from-Python/m-p/538962#M76007</guid>
      <dc:creator>Sburel</dc:creator>
      <dc:date>2022-08-31T02:34:51Z</dc:date>
    </item>
  </channel>
</rss>

