cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
0 Kudos

Python Dataframe to JMP Datatable without intermediate csv

It looks like the interface between a python dataframe and a jmp datatable goes through a csv file. Is that true?

For example:

 

Python Init(Path("C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\python37.dll"));
Python Submit( "\[import pandas as pd
df = pd.read_parquet('c:/temp/tst.parquet')
]\" );
dt = Python Get(df); // this method is saving the df as csv and then opens it in jmp. Is there a way to do that in memory
dt << New Data View;
Python Term();

 

In the above code I see JMP opening a progress bar for reading a csv during the Python Get(df) call. This is taking a very long time in large files.

We would like a way to import the data-frame to data-table w/o the time to save as csv and reading it

6 Comments
Ryan_Gilmore
Community Manager
Status changed to: Archived
We are archiving this request. If this is still important please comment with additional details and we will reopen. Thank you!
hogi
Level XII

Thanks for implementing this Wish in Jmp 18

hogi
Level XII

@Sarah-Sylvestre  - delivered?

Status changed to: Delivered
 
Ressel
Level VII

@Sarah-Sylvestre, it looks like the Python dataframe still goes via a csv to become a JMP table. Am I misunderstanding something?

Ressel_0-1746821145047.png

 

Paul_Nelson
Staff

JMP 14-17 Python Send ( dt )   created a copy of the data table as a pandas dataframe.  

JMP 18_+ creates a jmp.DataTable object which is a live reference to the data.

 

Python Get ( dt ) get's a JSL reference to the Python data table object.

 

Python Get ( df )  creates a data table from a pandas dataframe that is a COPY of the data. 

JMP 18 - Python Get ( df )  does indeed use CSV to get a DataFrame as JMP DataTable, that was left for compatibility.  You should be making a dt from the df in Python and using the dt with Python Get().

 

JMP 19 adds Portable Dataframe Protocol support so that it is easy to create a JMP DataTable from a Pandas dataframe in memory without having to walk the columns and build columns yourself.  dt = jmp.from_dataframe( df )

 

In JMP 19 Python Get ( df ) should create a new data table which is a COPY directly from the dataframe in memory.  If it cannot automatically convert in memory for whatever reason, it falls back to CSV instead of failing.