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

 

 

4 REPLIES 4

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

Recommended Articles