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
zetaVagabond1
Level III

JMP19 - Dataframe Interchange Protocol deprecation warning

Seeing this in my JSL Logs recently, has jmp19 adapted to something else ? This will eventually be phased out, i have used a custom fuction to convert jmp table to pandas dataframe in jmp18 but that didn't work for jmp19. So, what are the ways to achieve the same now? 

 

I run my python code inside the JSL Script. 

 

Python Send(o28k_raw);
Python Submit(
raw_data = pd.api.interchange.from_dataframe(o28k_raw)
);

This warning: 

 

 

<string>:18: Pandas4Warning: The Dataframe Interchange Protocol is deprecated.
For dataframe-agnostic code, you may want to look into:
- Arrow PyCapsule Interface: https://arrow.apache.org/docs/format/CDataInterface/PyCapsuleInterface.html
- Narwhals: https://github.com/narwhals-dev/narwhals

 

 

7 REPLIES 7

Re: JMP19 - Dataframe Interchange Protocol deprecation warning

Have you seen Going further with Python in JMP 19 - JMP User Community?

Working with Pandas Dataframes became easier in JMP 19, using the new function jmp.from_dataframe(). 

zetaVagabond1
Level III

Re: JMP19 - Dataframe Interchange Protocol deprecation warning

I found below mentioned code from the same link but the query is diff as I have mentioned.

pd.api.interchange.from_dataframe()

Re: JMP19 - Dataframe Interchange Protocol deprecation warning

Interesting, when I run the following Python script I do not see any warnings: 

 

import jmp
import pandas as pd

dt = jmp.open(jmp.SAMPLE_DATA + "Big Class.jmp")
pandas_df = (pd.api.interchange.from_dataframe(dt))
print(pandas_df) 

 

Could you check to see if the error occurs when running the Python from within JMP's Python editor, or if it is specific to Python executed using Python Submit? 

I also tried the following at it did not give me an error: 

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
Python Send( dt );
Python Submit( "pandas_df = (pd.api.interchange.from_dataframe(dt))" );
Python Submit( "dt2 = jmp.from_dataframe(pandas_df)" );
Python Get(dt2);

Could you test these scripts to see if they also give the same warning on your end? 

 

 

 

 

zetaVagabond1
Level III

Re: JMP19 - Dataframe Interchange Protocol deprecation warning

I see this warning when I run python executed using Python Submit as well as when I run the python script from JMP's python editor

pandas_df = (pd.api.interchange.from_dataframe(dt))
/*:
<string>:1: Pandas4Warning: The Dataframe Interchange Protocol is deprecated.
For dataframe-agnostic code, you may want to look into:
- Arrow PyCapsule Interface: https://arrow.apache.org/docs/format/CDataInterface/PyCapsuleInterface.html
- Narwhals: https://github.com/narwhals-dev/narwhals
//:*/
import jmp
import pandas as pd

dt = jmp.open(jmp.SAMPLE_DATA + "Big Class.jmp")
pandas_df = (pd.api.interchange.from_dataframe(dt))
print(pandas_df)
/*:
<string>:5: Pandas4Warning: The Dataframe Interchange Protocol is deprecated.
For dataframe-agnostic code, you may want to look into:
- Arrow PyCapsule Interface: https://arrow.apache.org/docs/format/CDataInterface/PyCapsuleInterface.html
- Narwhals: https://github.com/narwhals-dev/narwhals

Re: JMP19 - Dataframe Interchange Protocol deprecation warning

Thanks for the reply. The Python snippet above is from the scripting index, so it usually runs without any issues. 

In case you are not running the latest version of JMP (19.1.2), it might be a good idea to update and then try again. If you are already on the latest version, then I would recommend reaching out to JMP Technical Support support@jmp.com

Re: JMP19 - Dataframe Interchange Protocol deprecation warning

The warning comes about with pandas 3.0 and greater

Re: JMP19 - Dataframe Interchange Protocol deprecation warning

The warning is coming from pandas itself.  

We have made the updates internally to utilize the PyCapsule interface.  Exactly when that ships will be a matter of testing to ensure stability.  This will also add the jmp.from_arrow() function and extension of the jmp.DataTable object to support the Arrow interface requirements.  The jmp.from_dataframe() is reworked internally to utilize the new functionality.

import pandas as pd

dt = jmp.open(jmp.SAMPLE_DATA + "Big Class.jmp")
pandas_df = pd.DataFrame.from_arrow(dt)
print(pandas_df) 

 

Recommended Articles