Re: initialize a dictionary

2005-03-30 Thread Steven Bethard
[EMAIL PROTECTED] wrote: I need to iterate values by row and column as well. I tried this w,x = 32, 16 A = [ [0x0]*w for i in range(x)] print A py> import numarray py> print numarray.zeros((16, 8)) [[0 0 0 0 0 0 0 0] [0 0 0 0 0 0 0 0] [0 0 0 0 0 0 0 0] [0 0 0 0 0 0 0 0] [0 0 0 0 0 0 0 0] [

Re: initialize a dictionary

2005-03-30 Thread shama . bell
The F.A.Q. does not explain how to create a 2 dimensional array and initialize it to zero. I need to iterate values by row and column as well. I tried this w,x = 32, 16 A = [ [0x0]*w for i in range(x)] print A It does not create a 2 dimensional array with 32 rows and 16 columns Thanks, -SB

Re: initialize a dictionary

2005-03-30 Thread Sean Blakey
On 30 Mar 2005 13:02:05 -0800, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hello, > > Can I do something like this? > > table = {} > table[32, 16] = 0x0 > > Where 32 specifies rows and 16 specifies columns and i am trying to > initialize it to zero > > I should be able to do comparisons like

initialize a dictionary

2005-03-30 Thread shama . bell
Hello, Can I do something like this? table = {} table[32, 16] = 0x0 Where 32 specifies rows and 16 specifies columns and i am trying to initialize it to zero I should be able to do comparisons like: table[t1, t2] == 0x1 etc. -SB -- http://mail.python.org/mailman/listinfo/python-list