dict_keys_to_int#
- sionna.phy.utils.dict_keys_to_int(x: Any) Any[source]#
Converts the string keys of an input dictionary to integers whenever possible.
- Parameters:
x (Any) – Input dictionary.
- Outputs:
x – Dictionary with integer keys where conversion is possible.
Examples
from sionna.phy.utils import dict_keys_to_int dict_in = {'1': {'2': [45, '3']}, '4.3': 6, 'd': [5, '87']} print(dict_keys_to_int(dict_in)) # {1: {'2': [45, '3']}, '4.3': 6, 'd': [5, '87']}