Given a complexList [ [a1,b1,c1], [a2,b2,c2], [a3,b3,c3] ], return a list [ a, b, c] where a = a1+a2+a3, etc.
(complexList)
| 149 | |
| 150 | #======================================================================== |
| 151 | def sumInList(complexList): |
| 152 | ''' Given a complexList [ [a1,b1,c1], [a2,b2,c2], [a3,b3,c3] ], |
| 153 | return a list [ a, b, c] where a = a1+a2+a3, etc.''' |
| 154 | d = rezip(complexList) |
| 155 | return [ reduce(lambda x,y:x+y, z) for z in d ] |
| 156 | |
| 157 | #======================================================================== |
| 158 | def avgInList(complexList): |