Subscribe Bookmark RSS Feed

Saving a Max Value to a Python Script

tylerram93

Contributor

Joined:

Jul 20, 2017

I have a Column of Max Ic's, but need to output the max to a Python Script that runs a fitting algorithm to it! Any ideas about how to fix my (newbie) mistake?

 

Thanks for all the help!

Column2 = column(dt,"Max Ic (mA)");
MaxIc = Col Max(Column2);
Save Text File("$DataExtraction.py", str(MaxIc), Mode("Append") );
1 ACCEPTED SOLUTION

Accepted Solutions
Craige_Hales

Staff

Joined:

Mar 21, 2013

Solution

You didn't say what was wrong, but I'll make a guess: The python script in $DataExtraction.py no longer runs because it has a bunch of numbers appended to the end that don't look like valid Python. 

Maybe you want to write a CSV file from JMP and have the Python program read that (using Python's CSV library.) Or, if it really is only a single number, write that number to a separate .txt file and read that back in in the Python program.

I don't think you want JMP appending data to the end of a .py file.

Or, maybe something else is wrong. Be sure to check the JMP Log window for messages.

Craige
1 REPLY
Craige_Hales

Staff

Joined:

Mar 21, 2013

Solution

You didn't say what was wrong, but I'll make a guess: The python script in $DataExtraction.py no longer runs because it has a bunch of numbers appended to the end that don't look like valid Python. 

Maybe you want to write a CSV file from JMP and have the Python program read that (using Python's CSV library.) Or, if it really is only a single number, write that number to a separate .txt file and read that back in in the Python program.

I don't think you want JMP appending data to the end of a .py file.

Or, maybe something else is wrong. Be sure to check the JMP Log window for messages.

Craige