"You can write Python code with JMP!"
While this is true, this statement alone might lead some to think, "Why bother writing it in JMP when you can just use a Python editor or integrated development environment?"
What I will explain next is the Python integration feature included in JMP. By using this feature,
"JMP's functionality can be enhanced and extended using a Python environment."
This is one of the advantages.

However, even with this explanation, you might still not quite get it and be wondering, "So what exactly can it do?"
Therefore, in this blog series (4 parts in total), I will explain what it can actually do and what its benefits are, using specific code and usage examples.
In this first installment, we will introduce the advantages of combining Python and JMP through a simple example. Specifically, we will cover the following topics:
- JMP includes a Python environment.
- How to write and run Python code using the Python Script Editor
- Package installation and JMP's own jmp/jmputils packages
- Example use: Visualize economic indicator data obtained with pandas_datareader using JMP's bubble plot.
*This article assumes the use of the Windows version of JMP.
The Python environment will be installed in JMP.
As of the time of writing this article, the latest version of JMP is "JMP 19," but its Python integration capabilities have been significantly expanded compared to the previous version, "JMP 18."
When you install JMP, the Python environment is also installed in the installation folder. Therefore, you do not need to install Python separately on the machine where you will be using JMP.
Furthermore, this Python environment allows you to write and execute Python code in the JMP editor, and use the jmp package to manipulate JMP data tables and other elements.

*Note: Users do not need to run the above "jmp_python.exe" themselves.
Python script editor
JMP's "Python Script Editor" allows you to write and execute Python code directly within the editor.
Selecting [File] > [New] > [Python Script] from the JMP home window menu opens the Python script editor. The code you write can be executed by selecting [Edit] > [Run Script], and the execution results are output to the log window.

Package installation and loading
When using packages like pandas or NumPy in Python, you first need to install these packages and then load them in your code using import statements.
Similarly, in the JMP Python integrated environment, you need to install packages within that environment in order to use them.
Additionally, you can use JMP's own packages called jmp and jmputils . These packages primarily allow you to do the following:
- jmp : Manipulating JMP data tables (creating new ones, adding/deleting/modifying columns, etc.), retrieving information from an open JMP data table.
- jmputils : Installing packages into the JMP Python integrated environment
In the following examples, we will be using the Python pandas package and the pandas_datareader package, so install them with the following command.

Once installed within the JMP Python environment, you won't need to reinstall it after closing JMP.
Benefits of using the Python integrated environment with JMP
The advantage of using the Python integrated development environment with JMP lies in its ability to combine the strengths of both Python and JMP. Here are some of their respective strengths:
Python: Allows you to use features and analytical methods not included in JMP.
Python has numerous packages available that implement data acquisition and the latest analysis techniques. By using these, you can incorporate features and methods that are not included as standard in JMP into your analysis.
JMP: GUI operation,I'm good at "exploring" data.
On the other hand, JMP excels in data exploration features such as GUI-based data table manipulation, interactive analysis, and linking graphs and data tables. Implementing these operations using only Python is not easy.
In other words, you can use Python to broaden the range of analytical methods and JMP to explore and visualize the results, thus complementing each other's strengths .
This will be explained in the following Example 1.
Example 1: Loading and visualizing economic indicator data using pandas_datareader
The Python package pandas_datareader can be used to retrieve country-specific economic data provided by the World Bank.
Therefore, we will use the JMP Python integrated environment to acquire this data and load it as a JMP data table. Furthermore, we will use JMP's "bubble plot" to visualize the trends of indicators year by year and country by country.
Data to be obtained : Annual per capita GDP, life expectancy, and population for G7 countries from 2000 to 2024.
The code example is as follows (Example1-1_WorldBank.py, included with this blog). If you regularly write Python code, you will see that it is written in the same way as regular Python code.
This code primarily describes the following two things:
- Import the pandas_datareader package to retrieve World Bank data.
- The acquired data (in DataFrame format) is modified, including changing column names, and then imported as a JMP data table.

jmp.from_dataframe() は、pandasなどのデータフレームからJMPのデータテーブルを作成する関数です。
- Of the code above, the only parts specific to JMP are ` import jmp` and the final `jmp.from_dataframe(df) `. Everything else is standard Python code.
Executing this command by selecting [Edit] > [Run Script] from the script editor menu will open a JMP data table like the one shown below.

We have now obtained the data as a JMP data table, so we can use JMP's functions to visualize and explore the data from here.
As an example, using JMP's [Bubble Plot], you can specify the columns as follows to see an animation of the relationship between GDP and life expectancy in each country over time.

The roles that Python and JMP played in this code and its subsequent analysis are as follows:
Python : Using pandas_datareader to retrieve economic indicator data from the World Bank.
JMP : Visualizes acquired data using a bubble plot with animation capabilities.
This is an example of how combining the strengths of both parties can lead to a successful series of analyses.
Furthermore, code written in Python scripts can be saved in Python code format (with the .py extension) by selecting [File] > [Save As].
Details of the jmp and jmputils packages (using the script index)
Details of the commands available in the jmp and jmputils packages can be found in the script index ([Help] > [Script Index]). Switching the item in the upper left to "Python" will allow you to view the syntax, description, and code examples for each command.

In conclusion
In the first installment, we introduced that JMP includes a Python environment, that you can execute code using the Python script editor, and that data obtained with Python can be treated as a JMP data table.
Next time ( Part 2 )This section will cover how to code the entire process from data acquisition to visualization (bubble plotting) for Example 1, and will discuss the differences between writing the code using Python (.py) and writing it using JSL (.jsl).
by Naohiro Masukawa (JMP Japan)
Naohiro Masukawa - JMP User Community