Re: reference data in a dictionary

2007-02-15 Thread Duncan Booth
"Wensui Liu" <[EMAIL PROTECTED]> wrote: > I know dict['row1'] will always work. but it will only get 1 row out > of the dict. is there anyway i can get multiple (>1) rows out of dict > by directly refeencing them, something like dict[['row1', 'row2']]. > [d[x] for x in ('row1', 'row2')] -- http:

Re: reference data in a dictionary

2007-02-14 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Wensui Liu wrote: > I know dict['row1'] will always work. but it will only get 1 row out > of the dict. is there anyway i can get multiple (>1) rows out of dict > by directly refeencing them, something like dict[['row1', 'row2']]. Not by directly referencing them, but with

Re: reference data in a dictionary

2007-02-14 Thread Wensui Liu
I know dict['row1'] will always work. but it will only get 1 row out of the dict. is there anyway i can get multiple (>1) rows out of dict by directly refeencing them, something like dict[['row1', 'row2']]. thank you for reply, Ben. wensui On 2/14/07, Ben Finney <[EMAIL PROTECTED]> wrote: > "Wen

Re: reference data in a dictionary

2007-02-14 Thread Ben Finney
"Wensui Liu" <[EMAIL PROTECTED]> writes: > i am new to python and have a question about referencing data in a > dict. is there anyway that allows me to do something like: > dict[['row1', 'row2', .'row100']] What behaviour would you expect from that statement? If we know what you're trying t

reference data in a dictionary

2007-02-14 Thread Wensui Liu
dear all, i am new to python and have a question about referencing data in a dict. is there anyway that allows me to do something like: dict[['row1', 'row2', .'row100']] thanks much. -- WenSui Liu A lousy statistician who happens to know a little programming (http://spaces.msn.com/statcomput