On Fri, Mar 20, 2009 at 7:28 AM, MRAB wrote:
> Chris Rebert wrote:
>>
>> On Fri, Mar 20, 2009 at 4:34 AM, Alessandro Zivelonghi
>> wrote:
>>>
>>> Many Thanks guys!
>>>
>>> and what if I need to look ONLY into the second and third columns,
>>> excluding the first item of each rows?
>>>
>>> for exa
this seems to work. Thanks!
Alex
x= 3
indices = [i for i, row in enumerate(mat) if x in row[1:]]
2009/3/20 Chris Rebert :
> On Fri, Mar 20, 2009 at 4:34 AM, Alessandro Zivelonghi
> wrote:
>> Many Thanks guys!
>>
>> and what if I need to look ONLY into the second and third columns,
>> excluding t
Chris Rebert wrote:
On Fri, Mar 20, 2009 at 4:34 AM, Alessandro Zivelonghi
wrote:
Many Thanks guys!
and what if I need to look ONLY into the second and third columns,
excluding the first item of each rows?
for example if x = 3 I need to get [0] and not [0,1]
indices = [i for i, row in enum
On Fri, Mar 20, 2009 at 4:34 AM, Alessandro Zivelonghi
wrote:
> Many Thanks guys!
>
> and what if I need to look ONLY into the second and third columns,
> excluding the first item of each rows?
>
> for example if x = 3 I need to get [0] and not [0,1]
indices = [i for i, row in enumerate(mat) if
Many Thanks guys!
and what if I need to look ONLY into the second and third columns,
excluding the first item of each rows?
for example if x = 3 I need to get [0] and not [0,1]
many thanks, Alex
2009/3/20 Tino Wildenhain :
> Alexzive wrote:
>>
>> Hello there,
>>
>> let's suppose I have the fo
Alexzive wrote:
Hello there,
let's suppose I have the following matrix:
mat = [[1,2,3], [3,2,4], [7,8,9], [6,2,9]]
where [.. , .. , ..] are the rows.
I am interested into getting the "row index" of all the matrix rows
where a certain number occurs.
For example for 9 I should get 2 and 3 (star
On Fri, Mar 20, 2009 at 3:50 AM, Alexzive wrote:
> Hello there,
>
> let's suppose I have the following matrix:
>
> mat = [[1,2,3], [3,2,4], [7,8,9], [6,2,9]]
>
> where [.. , .. , ..] are the rows.
>
> I am interested into getting the "row index" of all the matrix rows
> where a certain number occu
Hello there,
let's suppose I have the following matrix:
mat = [[1,2,3], [3,2,4], [7,8,9], [6,2,9]]
where [.. , .. , ..] are the rows.
I am interested into getting the "row index" of all the matrix rows
where a certain number occurs.
For example for 9 I should get 2 and 3 (starting from 0).
For