Export Variables

22 views
Skip to first unread message

Andrew Usher

unread,
May 27, 2022, 4:58:16 PM5/27/22
to lmfit-py
Hi, 
Is there a way to dump the variables into a dataframe from the report.
[[Variables]] a1: 30.5618636 (init = 39) td1: 15.9157178 (init = 1) t1: 40.8511809 (init = 30)
Ideally I want to dump a1, td1 and t1 into new dataframe with an append, as I am looping through a dataset running the LMFIT on selection of data.

Hope that makes sense,

Huge Thanks,

Andrew

Andrew Usher

unread,
May 27, 2022, 5:47:13 PM5/27/22
to lmfit-py
I can pull it into datafame with best_values, but ideally would like it per value from that dict.
So the a1 value into one column etc.

Michal Pelach

unread,
Jun 2, 2022, 4:56:18 AM6/2/22
to lmfit-py
you can play from here and adapt

    lst = []
    for name, param in out.params.items():
        lst.append(param.value)
        lst.append(param.stderr)
Reply all
Reply to author
Forward
0 new messages