Python exit code












0















quick question here.



When I run my Python script (Py 3.7.2) I got this code:
Process finished with exit code -1
In general I would expect exit code 0, but why there is -1?



Kind regards



UPDATE!
I've added some code to give you an insight into my problem.



import numpy as np
import matplotlib.pyplot as plt
from lmfit import Model

def read_datafile(file_name):
data = np.loadtxt(file_name, delimiter=' ')
return data

def decomposition2(x, amp, cen, sig, e):
return float(amp) * (1 + float(e) * (x - float(cen))) / (pow((x - float(cen)), 2) + pow((float(sig) / 2), 2))


for r in range(20, 91, 1):
dataread = np.loadtxt("S:/Data/Model4/Mod{}.csv".format(r), delimiter=' ',
unpack=True)

x = dataread[0,]
y = dataread[1,]

peak1b = Model(decomposition2, prefix='p1b_')
peak2b = Model(decomposition2, prefix='p2b_')
peak3b = Model(decomposition2, prefix='p3b_')
peak4b = Model(decomposition2, prefix='p4b_')


model2 = peak1b + peak2b + peak3b + peak4b

params2 = model2.make_params(p1b_amp=1, p1b_cen=7.708, p1b_sig=4.43, p1b_e=0,
p2b_amp=1, p2b_cen=13.880, p2b_sig=5.26, p2b_e=0,
p3b_amp=1, p3b_cen=20.037, p3b_sig=5.78, p3b_e=0,
p4b_amp=1, p4b_cen=26.237, p4b_sig=6.16, p4b_e=0)

result2 = model2.fit(y, params2, x=x, fit_kws={'maxfev':20000000})
final2 = result2.best_fit









share|improve this question

























  • What code are you running?

    – Mad Physicist
    Jan 1 at 17:57











  • lmifit, matplotlib, numpy libraries.

    – Hiddenguy
    Jan 1 at 18:38











  • Please provide a minimal script that reproduces your issue. It's impossible to say which of many possibilities produced your error without knowing what you did.

    – Mad Physicist
    Jan 1 at 18:47
















0















quick question here.



When I run my Python script (Py 3.7.2) I got this code:
Process finished with exit code -1
In general I would expect exit code 0, but why there is -1?



Kind regards



UPDATE!
I've added some code to give you an insight into my problem.



import numpy as np
import matplotlib.pyplot as plt
from lmfit import Model

def read_datafile(file_name):
data = np.loadtxt(file_name, delimiter=' ')
return data

def decomposition2(x, amp, cen, sig, e):
return float(amp) * (1 + float(e) * (x - float(cen))) / (pow((x - float(cen)), 2) + pow((float(sig) / 2), 2))


for r in range(20, 91, 1):
dataread = np.loadtxt("S:/Data/Model4/Mod{}.csv".format(r), delimiter=' ',
unpack=True)

x = dataread[0,]
y = dataread[1,]

peak1b = Model(decomposition2, prefix='p1b_')
peak2b = Model(decomposition2, prefix='p2b_')
peak3b = Model(decomposition2, prefix='p3b_')
peak4b = Model(decomposition2, prefix='p4b_')


model2 = peak1b + peak2b + peak3b + peak4b

params2 = model2.make_params(p1b_amp=1, p1b_cen=7.708, p1b_sig=4.43, p1b_e=0,
p2b_amp=1, p2b_cen=13.880, p2b_sig=5.26, p2b_e=0,
p3b_amp=1, p3b_cen=20.037, p3b_sig=5.78, p3b_e=0,
p4b_amp=1, p4b_cen=26.237, p4b_sig=6.16, p4b_e=0)

result2 = model2.fit(y, params2, x=x, fit_kws={'maxfev':20000000})
final2 = result2.best_fit









share|improve this question

























  • What code are you running?

    – Mad Physicist
    Jan 1 at 17:57











  • lmifit, matplotlib, numpy libraries.

    – Hiddenguy
    Jan 1 at 18:38











  • Please provide a minimal script that reproduces your issue. It's impossible to say which of many possibilities produced your error without knowing what you did.

    – Mad Physicist
    Jan 1 at 18:47














0












0








0








quick question here.



When I run my Python script (Py 3.7.2) I got this code:
Process finished with exit code -1
In general I would expect exit code 0, but why there is -1?



Kind regards



UPDATE!
I've added some code to give you an insight into my problem.



import numpy as np
import matplotlib.pyplot as plt
from lmfit import Model

def read_datafile(file_name):
data = np.loadtxt(file_name, delimiter=' ')
return data

def decomposition2(x, amp, cen, sig, e):
return float(amp) * (1 + float(e) * (x - float(cen))) / (pow((x - float(cen)), 2) + pow((float(sig) / 2), 2))


for r in range(20, 91, 1):
dataread = np.loadtxt("S:/Data/Model4/Mod{}.csv".format(r), delimiter=' ',
unpack=True)

x = dataread[0,]
y = dataread[1,]

peak1b = Model(decomposition2, prefix='p1b_')
peak2b = Model(decomposition2, prefix='p2b_')
peak3b = Model(decomposition2, prefix='p3b_')
peak4b = Model(decomposition2, prefix='p4b_')


model2 = peak1b + peak2b + peak3b + peak4b

params2 = model2.make_params(p1b_amp=1, p1b_cen=7.708, p1b_sig=4.43, p1b_e=0,
p2b_amp=1, p2b_cen=13.880, p2b_sig=5.26, p2b_e=0,
p3b_amp=1, p3b_cen=20.037, p3b_sig=5.78, p3b_e=0,
p4b_amp=1, p4b_cen=26.237, p4b_sig=6.16, p4b_e=0)

result2 = model2.fit(y, params2, x=x, fit_kws={'maxfev':20000000})
final2 = result2.best_fit









share|improve this question
















quick question here.



When I run my Python script (Py 3.7.2) I got this code:
Process finished with exit code -1
In general I would expect exit code 0, but why there is -1?



Kind regards



UPDATE!
I've added some code to give you an insight into my problem.



import numpy as np
import matplotlib.pyplot as plt
from lmfit import Model

def read_datafile(file_name):
data = np.loadtxt(file_name, delimiter=' ')
return data

def decomposition2(x, amp, cen, sig, e):
return float(amp) * (1 + float(e) * (x - float(cen))) / (pow((x - float(cen)), 2) + pow((float(sig) / 2), 2))


for r in range(20, 91, 1):
dataread = np.loadtxt("S:/Data/Model4/Mod{}.csv".format(r), delimiter=' ',
unpack=True)

x = dataread[0,]
y = dataread[1,]

peak1b = Model(decomposition2, prefix='p1b_')
peak2b = Model(decomposition2, prefix='p2b_')
peak3b = Model(decomposition2, prefix='p3b_')
peak4b = Model(decomposition2, prefix='p4b_')


model2 = peak1b + peak2b + peak3b + peak4b

params2 = model2.make_params(p1b_amp=1, p1b_cen=7.708, p1b_sig=4.43, p1b_e=0,
p2b_amp=1, p2b_cen=13.880, p2b_sig=5.26, p2b_e=0,
p3b_amp=1, p3b_cen=20.037, p3b_sig=5.78, p3b_e=0,
p4b_amp=1, p4b_cen=26.237, p4b_sig=6.16, p4b_e=0)

result2 = model2.fit(y, params2, x=x, fit_kws={'maxfev':20000000})
final2 = result2.best_fit






python-3.x pycharm exit-code






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 1 at 19:54







Hiddenguy

















asked Jan 1 at 17:28









HiddenguyHiddenguy

273518




273518













  • What code are you running?

    – Mad Physicist
    Jan 1 at 17:57











  • lmifit, matplotlib, numpy libraries.

    – Hiddenguy
    Jan 1 at 18:38











  • Please provide a minimal script that reproduces your issue. It's impossible to say which of many possibilities produced your error without knowing what you did.

    – Mad Physicist
    Jan 1 at 18:47



















  • What code are you running?

    – Mad Physicist
    Jan 1 at 17:57











  • lmifit, matplotlib, numpy libraries.

    – Hiddenguy
    Jan 1 at 18:38











  • Please provide a minimal script that reproduces your issue. It's impossible to say which of many possibilities produced your error without knowing what you did.

    – Mad Physicist
    Jan 1 at 18:47

















What code are you running?

– Mad Physicist
Jan 1 at 17:57





What code are you running?

– Mad Physicist
Jan 1 at 17:57













lmifit, matplotlib, numpy libraries.

– Hiddenguy
Jan 1 at 18:38





lmifit, matplotlib, numpy libraries.

– Hiddenguy
Jan 1 at 18:38













Please provide a minimal script that reproduces your issue. It's impossible to say which of many possibilities produced your error without knowing what you did.

– Mad Physicist
Jan 1 at 18:47





Please provide a minimal script that reproduces your issue. It's impossible to say which of many possibilities produced your error without knowing what you did.

– Mad Physicist
Jan 1 at 18:47












0






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53997486%2fpython-exit-code%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53997486%2fpython-exit-code%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Monofisismo

Angular Downloading a file using contenturl with Basic Authentication

Olmecas