params provided as list with parameter of single value
See original GitHub issueWhen setting the initial parameters of the system to a single value, i.e. no parameter sweep, the params are provided as a list to the state update and policy functions rather than a dictionary. This isn’t expected correct?
The following error is thrown TypeError: list indices must be integers or slices, not str
which is simply solved by accessing the specific parameter after selecting the first list index:
m = {
'a': [2]
}
...
def policy_function_1(_params, substep, sH, s, **kwargs):
a = _params[0]['a']
return {'a': a}
Issue Analytics
- State:
- Created 3 years ago
- Comments:13 (10 by maintainers)
Top Results From Across the Web
Python, allowing passing single string and list of string to a ...
Now, I could force the user to enter a list with only one value ( names=['ERRI'] or names=('ERII',) . I would prefer to...
Read more >10.19. Using Lists as Parameters - Runestone Academy
Functions which take lists as arguments and change them during execution are called modifiers and the changes they make are called side effects....
Read more >params keyword for parameter arrays - C# reference
The parameter type must be a single-dimensional array. ... A comma-separated list of arguments of the type of the array elements.
Read more >Parameter types — param v1.12.3 - HoloViz
Selector accepts a list or dictionary of objects , and has a single default (current) value that must be one of those objects....
Read more >Python Passing a List as an Argument - W3Schools
Passing a List as an Argument. You can send any data types of argument to a function (string, number, list, dictionary etc.), and...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Using the hot_fix, it’s working
Hot fix #183