I have the parameters of a model I am running in a JSON file, which I read through the JSON Reader node like this:
I plug this node into a Python Script node, and I get successfully read:
I use “my_parameter_combinations = knio.input_tables[0].to_pandas()”, and when reading the JSON so that the rest of the model can read what I have defined in the JSON as model 1 or 2, like this:
the error says that my_parameter_combinations['json'][0] is a dict (Python dictionary).
The question is, what do you want? You used json.loads. This method returns a dict. You already have a dict. There is no need to transform it.
If you do not want a dict, but a String in JSON format, then you can transform the dict via a = json.dumps(my_parameter_combinations['json'][0])