cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
altug_bayram
Level V

JMP Python Script Interface to point to Python installation different than JMP native folders

Hello

I am looking to writing a script that sends data from a JMP table,  executes a python library, returns outputs back to JMP. 

Some of these libraries can be very strictly requiring a specific Python installation. Additionally, we certainly have an independent Python  installation (ie. local, and this is what I refer to as non-jmp python) . 

I am new to JMP python scripting and going through https://www.jmp.com/support/help/en/18.1/index.shtml#page/jmp/install-a-python-package.shtml# for basics but my question is around whether or not if the capability exists to direct JMP to folder different than native JMP installation for the preferred Python installation. If this capability exists, is it possible to post a starting JMP Python script example ? 

thanks

5 REPLIES 5
mmarchandFSLR
Level VI

Re: JMP Python Script Interface to point to Python installation different than JMP native folders

Prior to JMP 18, you could point JMP to a specific Python installation and have it run that.  To do that in JMP 18 or higher, I think you would have to use Run Program(), which doesn't seem ideal.

Re: JMP Python Script Interface to point to Python installation different than JMP native folders

JMP 14-17 attempt to utilize the Python installed on the user's system.  This really only worked for Python.org versions and had difficulty if there was more than one version of Python installed on the system.  If JMP correctly identified the Python version on the system everything worked fine...  When it didn't, it was nearly impossible for the user to specify the necessary parameters to point to the Python version.  JMP 14-17 only presented the interface through JSL scripting commands.  It also lead scripts that were not portable because the receiver of the script may not have Python installed or an incompatible version. 

JMP 18's goals were:

  • To insure Python worked with JMP right out of the box, no configuration necessary.  
  • Every user of JMP 18 would have the same Python 3.11.x version, so scripting compatibility would cease to be a problem. 
  • Provide a Python centric environment vs a JSL only interface to Python,
  • Provide easy installation of external Python packages to supplement JMP capabilities.
  • Begin providing better data exchange between JMP and Python environments, especially in regard to Data Tables becoming Zero-copy references instead of copies of data transferred through the filesystem between environments.

To accomplish the Zero-copy integration of data tables requires we link with the Python shared library, that is what sets the requirement that only JMP provided embedded Python can be utilized.

JMP 19 is bundled with Python 3.13.x.   JMP will continue to stay close to the current Python Releases due to bug-fixes and security updates.  We do ship updated version of Python with our maintenance releases, we will always maintain the same Major.Minor version across the specific JMP version's release cycle.  

JMP 20 will likely ship with 3.14.x

Think of the JMP environment as a JMP Specific virtual environment.  There is nothing that precludes you from using the JMP Python to interact with an external Python environment.  My suggestion would be to use the internal JMP Python to move data to a database, or pass it to the other Python environment via mmap ( shared memory ), sockets, ZeroMQ, ...   lots of ways to get there without having to write data back to the filesystem.

At which point either JSL's RunProgram() or Python's multiprocessing can be utilized to launch the other Python environment.

altug_bayram
Level V

Re: JMP Python Script Interface to point to Python installation different than JMP native folders

Thx for your replies. I am a bit slowed down w/ my ingestion of JMP Python documentation. I wish there was some sort of template w/ examples (and maybe there is) . May have further questions

My needs towards are Python are due to : 
1.EBM (Explainable Boosting Machines) - this is not available in JMP
2. SHAP specific plots .. SHAP can be obtained through different platforms but I do like the specific plot formats that the original SHAP library provides. 

Especially EBM specific versions of Python and scikit-learn. I guess the sample example that would speed me up how to install and execute a simple library and then get the output back to JMP as data table. I think I figured so far "how to install" portion. 

And the way I understand from the explanations: if a python lib that is not part of JMP installation folders is to be used, then the solution goes through Run_Program() 

mmarchandFSLR
Level VI

Re: JMP Python Script Interface to point to Python installation different than JMP native folders

In general, as long as a module is compatible with JMP's Python installation, you can use it.  You would install it using Python Install Packages( "package name <other package name>" ), assuming it's available through pip.

Re: JMP Python Script Interface to point to Python installation different than JMP native folders

Hi @altug_bayram,

"I wish there was some sort of template w/ examples"

The Scripting Index has some quick Python examples. Python Integration > Functions > from_dataframe has a few examples that might be what you're looking for.

Jed_Campbell_0-1769809223653.png

Not exactly the questions you're asking, but maybe helpful:

EBM (Explainable Boosting Machines)

I'm not super familiar with EBM, but the Predictor Screening platform in JMP and the Bootstrap Forest / Boosted Tree platforms in JMP Pro might do what you're looking to do. It seems from looking at a brief overview of EBM online that it would be kind of a mix of Bootstrap Forests and Boosted Trees, but that might be oversimplifying things.

SHAP specific plots

Would this link help with the plots?

Python specifics:

Ultimately, there shouldn't be any technical hurdles sending a data table to python, using python-specific libraries, then bringing the data and/or images back to JMP.

I've attached an example script that uses the ephem library to calculate planet locations, then pulls the data back to JMP for visualization. Note lines 9-10 install the ephem library from within JMP's Python environment and only need to be run once.

Recommended Articles