What would be the easiest way to rotate this dictionary:
{'item':{'w':{'c':1, 'd':2}, 'x':120, 'y':240, 'z':{'a':100, 'b':200}}}
in that:
{'item':{'y':240, 'z':{'b':200}}}
given just what you need vars y and b, keeping the dictionary structure? The size or number of elements or the depth of the dictionary should not matter, since the one I work with can be anywhere from 2 to 5 levels.
EDIT: I apologize for the type earlier and clarify, I am given an array of strings (for example, ['y', 'b']) that I need to find in the dictionary, and then save ONLY 'y' and "b", as well as any other keys to save the structure of the original dictionary, in this case it will be "z"
The best example can be found here where I need the chipset model, VRAM and resolution.
Regarding the comment, the input will be the link above as the start dictionary along with the array ['chipset model', 'vram', 'resolution'] as the storage list. He should return this:
{'Graphics/Displays':{'NVIDIA GeForce 7300 GT':{'Chipset Model':'NVIDIA GeForce 7300 GT', 'Displays':{'Resolution':'1440 x 900 @ 75 Hz'}, 'VRAM (Total)':'256 Mb'}}