This video includes Q&A from attendees who attended the live webinar on March 21, 2024. at time 25:36- 50:39 and 01:00:21 A summary of some of the Q&A is provided below. For a full answer, consider reviewing the Q&A in the video.
From @Paul_Nelson on 03-22-2024 04:03 PM
I want to clarify the response to the question:
Q: Does this mean JMP can't use other versions of Python?
JMP 18 will only utilize the installed embedded Python 3.11. Python Init() and Python Connect() parameters for selecting a Python installation have all been deprecated and the parameters ignored.
JMP 18's Python is an isolated environment so it will not (should not) conflict with other Python installations on your system. There is nothing that prevents you from utilizing your existing Python pipeline. You can use JMP's Python to get data to and from JMP to hand off to your existing pipeline.
@gail_massari wrote:Q: If I want to access a JMP data table from jupyter notebook in a different Python environment, would the 'import ‘JMP' instruction still work? A: No.
Q: If I want to access a JMP data table from jupyter notebook in a different Python environment, would the 'import ‘JMP' instruction still work?
A: No.
How about "same Python environment" - is it possible to link python IDEs like Spyder or Visual Studio Code Editors to the JMP Python installation?
To have all the Python programming functionality of the IDEs + the possibility to
import 'JMP'
The import jmp statement will only function from within JMP itself.
It is not implemented as a shared library or Python script, the bridge from Python to JMP functionality is C++ code internal to the JMP executable itself.
When sending tables with images to Python, is it possible to access the images from within Python?
# getColImage.py # # Description: # Get a picture from an image column using Python # JMP 18 only supports numeric and character column types for transfer # but the value can be grabbed via JSL, and passed to Python as a string # in the meantime. The Python code will need to trim off the # New Image( Char To Blob()) and decode the image back to binary. import jmp dt = jmp.open(jmp.SAMPLE_DATA + 'Big Class Families.jmp') jmp.run_jsl(''' Names Default to Here(1); dt = Current Data Table(); img = dt:picture[1]; // get the picture img_str = char(img); // make it a string Python Send(img_str); // send Python the string ''') # print the object's JSL representation # which is text encoding of the binary, a description of the # encoding and image format type. print(img_str)
With output:
New Image(Char To Blob( "1iVBORw0KGgoAAAANSUhEUgAAAEYAAABGCAYAAABxLuK ...
VORK5CYII=", "base64compressed" ), "png")
From the Python side you need to parse out the Blob string, compression method, and format, decode the image from text to binary.
However, an alternate and likely better way is to use << Get Pixels("rgba"); on the column to get a 4 element list of matrices which is supported via Python Send().
Updated getColImage.py
# getColImage.py # # Description: # Get a picture from an image column using Python # JMP 18 only supports numeric and character column types for transfer # but the value can be grabbed via JSL, and passed to Python as a string # in the meantime. The Python code will need to trim off the # New Image( Char To Blob()) and decode the image back to binary. # # Alternatively use << Get Pixels("rgba"); to get a list of matricies # which is passable from JSL to Python using Python Send(); # import jmp dt = jmp.open(jmp.SAMPLE_DATA + 'Big Class Families.jmp') jmp.run_jsl(''' Names Default to Here(1); dt = Current Data Table(); img = dt:picture[1]; // get the picture img_str = char(img); // make it a string Python Send(img_str); // send Python the string asRGBA = { r, g, b, a} = dt:picture[1] << Get Pixels("rgba"); Python Send(asRGBA); ''') # print the object's JSL representation # which is text encoding of the binary, a description of the # encoding and image format type. print(img_str) print(asRGBA)
This post originally written in German has been computer translated for you. When you reply, it will also be translated back to German.
Somewhere the first few lines of the post got clipped.
No, not directly possible using the Python Integration in JMP 18, but a work around is possible using JSL.
The focus on JMP 18 was character and numeric columns. Full support of the data table is current ongoing development.