파이썬과 JMP 18안녕하세요,
JMP 18에서 코드를 사용하려고 하는데, 어떻게 작동하는지 잘 모르겠습니다. 처음에 pythonn 패키지를 설치한 다음, 변수를 Python으로 전송하고 Python 코드를 실행합니다. 하지만 항상 다음 오류 중 하나가 발생합니다. numpy가 설치되어 있는데도 numpy를 인식하지 못하거나, 방금 전송한 변수를 더 이상 인식하지 못합니다.
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
lstMeasures = Column( dt, "height" ) << Get As Matrix();
Python Install Packages( "numpy pandas scipy" );
Python Send( lstMeasures );
Python Submit(
"
import numpy as np
from scipy.stats import kstest, norm, weibull_min, rayleigh
data = np.array(lstMeasures)
# Fit des lois
mu, sigma = norm.fit(data)
ks_norm = kstest(data, 'norm', args=(mu, sigma))
c, loc, scale = weibull_min.fit(data)
ks_weibull = kstest(data, 'weibull_min', args=(c, loc, scale))
loc_r, scale_r = rayleigh.fit(data)
ks_rayleigh = kstest(data, 'rayleigh', args=(loc_r, scale_r))
"
);
ks_norm = Python Get( ks_norm );
ks_weibull = Python Get( ks_weibull );
ks_rayleigh = Python Get( ks_rayleigh );


자동화 및 스크립팅Re: Python과 JMP 18JMP(JSL) 스크립트 편집기에서 정확히 그 코드를 실행하고 계신가요? 스크립트에는 아무런 문제가 없고 제 경우에는 잘 작동합니다.
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
lstMeasures = Column(dt, "height") << Get As Matrix();
Python Install Packages("numpy pandas scipy");
Python Send(lstMeasures);
Python Submit("
import numpy as np
from scipy.stats import kstest, norm, weibull_min, rayleigh
data = np.array(lstMeasures)
mu, sigma = norm.fit(data)
ks_norm = kstest(data, 'norm', args=(mu, sigma))
c, loc, scale = weibull_min.fit(data)
ks_weibull = kstest(data, 'weibull_min', args=(c, loc, scale))
loc_r, scale_r = rayleigh.fit(data)
ks_rayleigh = kstest(data, 'rayleigh', args=(loc_r, scale_r))
");
ks_norm = Python Get(ks_norm);
ks_weibull = Python Get(ks_weibull);
ks_rayleigh = Python Get(ks_rayleigh);
show(ks_norm, ks_weibull, ks_rayleigh);
@폴_넬슨
Re: Python과 JMP 18안녕하세요, JMP 18.0.0을 사용 중이었는데 JMP를 재시작했더니 더 이상 문제가 발생하지 않았습니다.
Re: Python과 JMP 18특히 JMP를 처음 실행할 때 새로 설치된 Python 패키지를 인식하기 위해 JMP를 다시 시작해야 할 수 있습니다. Numpy는 특히 까다롭습니다. 또한 Python의 패키지 처리 메커니즘은 가져오기에 실패한 패키지를 다시 찾지 않습니다. 실패했다는 것을 알고 있으므로 다시 시도할 필요가 없습니다. importlib과 reload를 사용하여 패키지를 강제로 다시 로드할 수 있습니다.