permuting over nested dicts?



Hoi,

I have the following data structure (of variable size actually, to make
things simple, just that one):
d = {'a': {'x':[1,2,3], 'y':[4,5,6]},
'b': {'x':[7,8,9], 'y':[10,11,12]}}
This can be read as a dict of possibilities: The entities 'a' and 'b' have
the parameters 'x' and 'y', each. And d['a']['x'] can be either 1 or 2 or
3. Does anybody know a convenient (and fast) way to permute over all
possible nested dicts like
{'a': {'x':1, 'y':4},
'b': {'x':7, 'y':10}}
and
{'a': {'x':2, 'y':4},
'b': {'x':7, 'y':10}}
and so forth?

Any link or snippet is appreciated.

TIA
Christian
.



Relevant Pages

  • Re: Ordering python sets
    ... No, when you program you know how you will be using the data structure, ... set, list and dict are highly optimized for general use, and are very ... A true dict/mapping type doesn't have that limitation, ...
    (comp.lang.python)
  • Re: An ordered dictionary for the Python library?
    ... Do other Python programmers feel this lack? ... It is worth having an ordered data structure of some kind. ... An API that is identical to a dict, ...
    (comp.lang.python)
  • Re: An ordered dictionary for the Python library?
    ... Do other Python programmers feel this lack? ... It is worth having an ordered data structure of some kind. ... An API that is identical to a dict, ...
    (comp.lang.python)
  • Re: Ordering python sets
    ... As Python becomes accepted for more and more "serious" projects some ... - Bidict: a unordered dict that allows Oretrieval ... a directed unsorted data structure like mine may be acceptable ... A problem with the Chain data structure is how to represent iterators ...
    (comp.lang.python)
  • Re: Ordering python sets
    ... When I see a dict, I want to know that any two dicts work the same way. ... I got this idea from a book about algorithm and data structure, ... competing implementations or data structures (e.g. binary tree dict, ... How more explicit can you be than: ...
    (comp.lang.python)