Re: locate items in matrix (index of lists of lists)

2009-03-20 Thread Alessandro Zivelonghi
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 thi

Re: locate items in matrix (index of lists of lists)

2009-03-20 Thread Alessandro Zivelonghi
; x=9 > > [idx for idx,row in enumerate(mat) if x in row] > > should do. > >> >> >> PS: this is just a simplified example, but I have actually to deal >> with large matrices [~50 * 4] > > This is something I'd consider either reordering

sorting mesh data an from abaqus simulation

2009-02-02 Thread Alessandro Zivelonghi
EL, N, Ntop (list?) and how can I sort Ntop with the criterium based on coordinate_x (coordinate[0]) Many thanks, Alex -- > Alessandro Zivelonghi > > http://www.tecnopolis.eu > > skype: alexzive > > "Energy and persistence conquer all things." > Benjamin Franklin (1706 - 1790) > -- http://mail.python.org/mailman/listinfo/python-list