Hello everyone.
I have constructed a program which provides an output as a .txt. I have to email this output and the reciever has requested me to send it as a .json instead. I have attempted to simply save the output replacing .txt by .json using export as.
Export["savedWindXPythonJ.json", savedXPython];
However, I recive an error message Export::badval: The element Data contains invalid values.
Is there a way to save the variable to a json any answer is appreciated?
I will attach the .txt version.
You can export a list of rules or an association to JSON, but what you have is a different Mathematica expression (a long formula). Any Mathematica expression can be converted to JSON using the “ExpressionJSON” format:
I am trying to send a mathematical expression readable by pyomo to another person. I have constructed it in Mathematica and then adapted it to Python’s grammar as
Since I want this to be executed without having to do any work on the file.
I have sent it as a txt but it seems that that is causing trouble.
That is why I am trying to convert the expression to a way that can be read using pyomo.