개발자 튜토리얼: JMP 18의 새로운 Python 통합 및 스크립팅 기능본 영상에는 2024년 3월 21일 라이브 웨비나에 참석한 참석자들의 Q&A가 포함되어 있습니다. 시간 25:36~50:39 및 01:00:21 Q&A 일부 요약은 아래에 제공됩니다. 전체 답변을 보려면 동영상의 Q&A를 검토해 보세요.
자동화 및 스크립팅답변: 개발자 튜토리얼: JMP 18의 새로운 Python 통합 및 스크립팅 기능나는 질문에 대한 답변을 명확히 하고 싶습니다.
Q: 이는 JMP가 다른 버전의 Python을 사용할 수 없다는 뜻인가요?
JMP 18은 설치된 내장 Python 3.11만 활용합니다. Python 설치를 선택하기 위한 Python Init() 및 Python Connect() 매개변수는 모두 더 이상 사용되지 않으며 매개변수가 무시됩니다.
JMP 18의 Python은 격리된 환경이므로 시스템의 다른 Python 설치와 충돌하지 않습니다 . 기존 Python 파이프라인을 활용하는 데 방해가 되는 것은 없습니다 . JMP의 Python을 사용하여 JMP와 데이터를 주고 받고 기존 파이프라인으로 전달할 수 있습니다.
답변: 개발자 튜토리얼: JMP 18의 새로운 Python 통합 및 스크립팅 기능
@gail_massari 가 썼습니다:
Q: 다른 Python 환경의 jupyter 노트북에서 JMP 데이터 테이블에 액세스하려는 경우 ''JMP' 가져오기' 명령이 계속 작동합니까?
답: 아니요.
"동일한 Python 환경"은 어떻습니까? Spyder나 Visual Studio Code Editor와 같은 Python IDE를 JMP Python 설치에 연결할 수 있습니까?
IDE의 모든 Python 프로그래밍 기능 + 다음과 같은 가능성을 갖기 위해
import 'JMP'
답변: 개발자 튜토리얼: JMP 18의 새로운 Python 통합 및 스크립팅 기능import jmp 문은 JMP 자체 내에서만 작동합니다.
이는 공유 라이브러리나 Python 스크립트로 구현되지 않습니다. Python에서 JMP 기능으로의 연결은 JMP 실행 파일 자체 내부의 C++ 코드입니다.
답변: 개발자 튜토리얼: JMP 18의 새로운 Python 통합 및 스크립팅 기능이미지가 포함된 테이블을 Python으로 보낼 때 Python 내에서 이미지에 액세스할 수 있나요?
답변: 개발자 튜토리얼: JMP 18의 새로운 Python 통합 및 스크립팅 기능# getColImage.py
#
# Description:
# Get a picture from an image column using Python
# JMP 18 only supports numeric and character column types for transfer
# but the value can be grabbed via JSL, and passed to Python as a string
# in the meantime. The Python code will need to trim off the
# New Image( Char To Blob()) and decode the image back to binary.
import jmp
dt = jmp.open(jmp.SAMPLE_DATA + 'Big Class Families.jmp')
jmp.run_jsl('''
Names Default to Here(1);
dt = Current Data Table();
img = dt:picture[1]; // get the picture
img_str = char(img); // make it a string
Python Send(img_str); // send Python the string
''')
# print the object's JSL representation
# which is text encoding of the binary, a description of the
# encoding and image format type.
print(img_str)
출력:
새 이미지(Blob에 대한 문자("1iVBORw0KGgoAAAANSUhEUgAAAEYAAABGCAYAAABxLuK ...
VORK5CYII=", "base64압축" ), "png")
Python 측에서는 Blob 문자열, 압축 방법 및 형식을 구문 분석하고 이미지를 텍스트에서 바이너리로 디코딩해야 합니다.
그러나 대안적이고 더 나은 방법은 << Get Pixels("rgba");를 사용하는 것입니다. 열에서 Python Send()를 통해 지원되는 행렬의 4개 요소 목록을 가져옵니다.
getColImage.py 업데이트됨
# getColImage.py
#
# Description:
# Get a picture from an image column using Python
# JMP 18 only supports numeric and character column types for transfer
# but the value can be grabbed via JSL, and passed to Python as a string
# in the meantime. The Python code will need to trim off the
# New Image( Char To Blob()) and decode the image back to binary.
#
# Alternatively use << Get Pixels("rgba"); to get a list of matricies
# which is passable from JSL to Python using Python Send();
#
import jmp
dt = jmp.open(jmp.SAMPLE_DATA + 'Big Class Families.jmp')
jmp.run_jsl('''
Names Default to Here(1);
dt = Current Data Table();
img = dt:picture[1]; // get the picture
img_str = char(img); // make it a string
Python Send(img_str); // send Python the string
asRGBA = { r, g, b, a} = dt:picture[1] << Get Pixels("rgba");
Python Send(asRGBA);
''')
# print the object's JSL representation
# which is text encoding of the binary, a description of the
# encoding and image format type.
print(img_str)
print(asRGBA)
답변: 개발자 튜토리얼: JMP 18의 새로운 Python 통합 및 스크립팅 기능게시물의 처음 몇 줄이 잘린 곳이 있습니다.
아니요. JMP 18의 Python 통합을 사용하여 직접적으로 가능하지는 않지만 JSL을 사용하면 해결이 가능합니다.
JMP 18의 초점은 문자 및 숫자 열이었습니다. 데이터 테이블에 대한 완전한 지원은 현재 진행 중인 개발입니다.