문맥:
I am using JMP 18 with Python integration to merge multiple datasets. The merge and processing in Python works correctly using pandas, but when I try to send the final pandas DataFrame back to JMP using Python Get(), the resulting JMP Data Table is empty. I want to create a JMP table from my pandas DataFrame in Python and access it in JSL.
내가 시도하고 있는 것의 예:
// Send JMP tables to Python Python Send(jmp_table1); Python Send(jmp_table2); // Python processing Python Submit(" import pandas as pd def jmp_to_pandas(jmp_table): cols = list(jmp_table) data_dict = {} for col in cols: data_dict[col.name] = list(col) return pd.DataFrame(data_dict) # Convert JMP tables to pandas DataFrames df1 = convert_jmp_to_pandas(jmp_table1) df2 = convert_jmp_to_pandas(jmp_table2) # Merge tables merged_df = pd.merge_asof(df2, df1, left_on='Time', right_on='Time', direction='nearest') "); // Attempt to bring merged DataFrame back to JMP dt_merged = Python Get(merged_df); dt_merged << Set Name("Merged_Data"); dt_merged << Show Window;
관찰된 문제:
-
dt_merged is created but contains no data. [하지만 데이터 프레임은 csv로 저장해서 사용할 수 있도록 생성되었습니다.]
-
Using global in Python does not seem to fix the issue.
-
Python Get() does not appear to recognize the pandas DataFrame correctly.
내가 원하는 것:
-
Python에서 pandas DataFrame을 JMP 테이블로 변환합니다.
-
적절한 이름으로 JSL로 접근하고, 창을 표시하고, 열을 조작합니다.
-
빈 테이블을 만들지 말고 모든 행/열을 유지하세요.
내가 고려하고 있는 잠재적 해결책:
환경:
-
제이엠피 18
-
Python 3.x(임베디드)
- JSL 스크립트 내부에서 사용
Python에서 JMP로 팬더 데이터 프레임을 다시 보내는 방법에 대한 지침이나 실제 사례를 알려주시면 감사하겠습니다!