Re: How to get indices of a two dimensional list

2006-06-30 Thread Gerard Flanagan
Gerard Flanagan wrote: > [EMAIL PROTECTED] wrote: > > I have a list > > > > x = [0] * 2 > > x = x * [2] > > x[1,1] = 7 > > > > This gives me the x value > > [[0,0] [0,0] [0,0] [0,7]] > > > > I want to get the indices of the value 7. > > i.e. something like > > i = a.index(max(a)) gives me '1' > >

Re: How to get indices of a two dimensional list

2006-06-30 Thread Gerard Flanagan
[EMAIL PROTECTED] wrote: > I have a list > > x = [0] * 2 > x = x * [2] > x[1,1] = 7 > > This gives me the x value > [[0,0] [0,0] [0,0] [0,7]] > > I want to get the indices of the value 7. > i.e. something like > i = a.index(max(a)) gives me '1' > > This only gives me the index in one dimension. Is

Re: How to get indices of a two dimensional list

2006-06-29 Thread Simon Forman
[EMAIL PROTECTED] wrote: > I have a list > > x = [0] * 2 > x = x * [2] You're certainly not doing that. >>> x = [0] * 2 >>> x = x * [2] Traceback (most recent call last): File "", line 1, in ? TypeError: can't multiply sequence by non-int And even if you *do* do what it looks like you think y

How to get indices of a two dimensional list

2006-06-29 Thread sramaswamy
I have a list x = [0] * 2 x = x * [2] x[1,1] = 7 This gives me the x value [[0,0] [0,0] [0,0] [0,7]] I want to get the indices of the value 7. i.e. something like i = a.index(max(a)) gives me '1' This only gives me the index in one dimension. Is there any method by which I can get (1,1) as the