I currently have a nested dictionary which looks like this:
series = {
'a': {'foo':'2', 'bar':'3', 'baz':'7', 'qux':'1'},
'b': {'foo':'6', 'bar':'4', 'baz':'3', 'qux':'0'},
'c': {'foo':'4', 'bar':'5', 'baz':'1', 'qux':'6'}
}
And I'm trying to convert the values from strings into integers.
I have tried this method:
newseries = dict((k,int(v)) for k,v in series.items())
But all I get is an error message saying:
TypeError: int() argument must be a string, a bytes-like object or a number, not 'dict'
What am I doing wrong?