Python und JMP 18Hallo,
Ich versuche, einen Code in JMP 18 zu verwenden, bin mir aber nicht sicher, wie er funktioniert. Ich installiere die Python-Pakete ganz am Anfang, sende dann meine Variablen an Python und führe den Python-Code aus. Ich erhalte jedoch immer eine der folgenden Fehlermeldungen: Entweder wird Numpy nicht erkannt, obwohl Numpy installiert ist, oder die Variable, die ich gerade gesendet habe, wird nicht mehr erkannt.
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 );


Automatisierung und SkriptingBetreff: Python und JMP 18Führen Sie genau diesen Code im Skripteditor von JMP (JSL) aus? Ich sehe keine Probleme mit dem Skript und es funktioniert bei mir einwandfrei
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);
@Paul_Nelson
Betreff: Python und JMP 18Hallo, ich habe JMP 18.0.0 verwendet, aber ich habe JMP neu gestartet und jetzt hatte ich keine Probleme mehr ...
Betreff: Python und JMP 18Manchmal, insbesondere beim ersten Ausführen von JMP, müssen Sie JMP neu starten, damit JMP neu installierte Python-Pakete erkennt. Numpy ist dabei besonders pingelig. Außerdem sucht Pythons Paketverwaltungsmechanismus nicht erneut nach Paketen, deren Import fehlgeschlagen ist. Er weiß, dass der Import fehlgeschlagen ist, also warum es noch einmal versuchen? Sie können einen Neuladeversuch des Pakets erzwingen, indem Sie importlib und reload verwenden.