permuting over nested dicts?
- From: Christian Meesters <meesters@xxxxxxxxxxxx>
- Date: Wed, 31 Oct 2007 18:21:58 +0100
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
.
- Follow-Ups:
- Re: permuting over nested dicts?
- From: Paddy
- Re: permuting over nested dicts?
- Prev by Date: Building libraries that my extensions can use. [distutils]
- Next by Date: Re: Method needed for skipping lines
- Previous by thread: Building libraries that my extensions can use. [distutils]
- Next by thread: Re: permuting over nested dicts?
- Index(es):
Relevant Pages
|