<?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: Python and JMP 18 in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Python-and-JMP-18/m-p/890284#M105218</link>
    <description>&lt;P&gt;&amp;nbsp;Hello, I was using JMP Pro 18.0.0 but I restarted JMP and now I had no more issue ...&lt;/P&gt;</description>
    <pubDate>Tue, 29 Jul 2025 12:09:42 GMT</pubDate>
    <dc:creator>SophieCuvillier</dc:creator>
    <dc:date>2025-07-29T12:09:42Z</dc:date>
    <item>
      <title>Python and JMP 18</title>
      <link>https://community.jmp.com/t5/Discussions/Python-and-JMP-18/m-p/890253#M105214</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am trying to use a piece of code in JMP 18, but I am not sure I understand how it works. I install the pythonn packages at the very beginning, then I send my variables to Python and run the Python code. But I always get one of the following errors: Either it does not detect numpy, even though numpy is installed, or it no longer detects the variable I just sent.&lt;/P&gt;
&lt;P&gt;&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" );
lstMeasures = Column( dt, "height" ) &amp;lt;&amp;lt; Get As Matrix();
		
		Python Install Packages( "numpy pandas scipy" );

		Python Send( lstMeasures );
		

		Python Submit(
			"
import numpy as np
from scipy.stats import kstest, norm, weibull_min, rayleigh

data = np.array(lstMeasures)

# Fit des lois
mu, sigma = norm.fit(data)
ks_norm = kstest(data, 'norm', args=(mu, sigma))

c, loc, scale = weibull_min.fit(data)
ks_weibull = kstest(data, 'weibull_min', args=(c, loc, scale))

loc_r, scale_r = rayleigh.fit(data)
ks_rayleigh = kstest(data, 'rayleigh', args=(loc_r, scale_r))
"
		);

		ks_norm = Python Get( ks_norm );
		ks_weibull = Python Get( ks_weibull );
		ks_rayleigh = Python Get( ks_rayleigh );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SophieCuvillier_0-1753778950656.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/79116i5E5A7AA60792FF5F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SophieCuvillier_0-1753778950656.png" alt="SophieCuvillier_0-1753778950656.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SophieCuvillier_1-1753779073576.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/79117iFABA87F322914DFE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SophieCuvillier_1-1753779073576.png" alt="SophieCuvillier_1-1753779073576.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Jul 2025 08:51:22 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Python-and-JMP-18/m-p/890253#M105214</guid>
      <dc:creator>SophieCuvillier</dc:creator>
      <dc:date>2025-07-29T08:51:22Z</dc:date>
    </item>
    <item>
      <title>Re: Python and JMP 18</title>
      <link>https://community.jmp.com/t5/Discussions/Python-and-JMP-18/m-p/890265#M105215</link>
      <description>&lt;P&gt;Are you running exactly that code in JMP's (JSL) Script editor? I don't quickly see any issues with the script and it does works fine for me&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

dt = Open("$SAMPLE_DATA/Big Class.jmp");
lstMeasures = Column(dt, "height") &amp;lt;&amp;lt; Get As Matrix();
Python Install Packages("numpy pandas scipy");

Python Send(lstMeasures);

Python Submit("
import numpy as np
from scipy.stats import kstest, norm, weibull_min, rayleigh

data = np.array(lstMeasures)

mu, sigma = norm.fit(data)
ks_norm = kstest(data, 'norm', args=(mu, sigma))

c, loc, scale = weibull_min.fit(data)
ks_weibull = kstest(data, 'weibull_min', args=(c, loc, scale))

loc_r, scale_r = rayleigh.fit(data)
ks_rayleigh = kstest(data, 'rayleigh', args=(loc_r, scale_r))
");

ks_norm = Python Get(ks_norm);
ks_weibull = Python Get(ks_weibull);
ks_rayleigh = Python Get(ks_rayleigh);

show(ks_norm, ks_weibull, ks_rayleigh);
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/7172"&gt;@Paul_Nelson&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Edit: Which JMP18 are you using?&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Jul 2025 09:26:36 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Python-and-JMP-18/m-p/890265#M105215</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2025-07-29T09:26:36Z</dc:date>
    </item>
    <item>
      <title>Re: Python and JMP 18</title>
      <link>https://community.jmp.com/t5/Discussions/Python-and-JMP-18/m-p/890284#M105218</link>
      <description>&lt;P&gt;&amp;nbsp;Hello, I was using JMP Pro 18.0.0 but I restarted JMP and now I had no more issue ...&lt;/P&gt;</description>
      <pubDate>Tue, 29 Jul 2025 12:09:42 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Python-and-JMP-18/m-p/890284#M105218</guid>
      <dc:creator>SophieCuvillier</dc:creator>
      <dc:date>2025-07-29T12:09:42Z</dc:date>
    </item>
    <item>
      <title>Re: Python and JMP 18</title>
      <link>https://community.jmp.com/t5/Discussions/Python-and-JMP-18/m-p/890285#M105219</link>
      <description>&lt;P&gt;Sometimes, especially the very first time JMP is run you may have to restart JMP in order for JMP to recognize newly installed Python packages. Numpy is particularly finicky. Also, Python's package handling mechanism doesn't look re-look for a package that failed to import. &amp;nbsp;It knows it failed so why try again. &amp;nbsp;You can force a package reload attempt by using importlib and reload. &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Jul 2025 12:28:01 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Python-and-JMP-18/m-p/890285#M105219</guid>
      <dc:creator>Paul_Nelson</dc:creator>
      <dc:date>2025-07-29T12:28:01Z</dc:date>
    </item>
  </channel>
</rss>

