|
Re: Using sum() within a function: msg#00048python.numeric.general
Example-- variables x,y,z,t; dimensions numX, numY, numZ, numT; Cobbling together a number of suggestions, what finally worked was-- def f3(x, y, z, t_range=arange(numT)): tempval = 0.* x for t in t_range: tempval += f1(x,y,z,t) + f2(y,z,t) return tempval out = fromfunction(f3,(numX,numY,numZ,1)) I couldn't quite get sum() to work inside the function, but this is definitely good enough for now. Thanks to all for your help. -Jim Cser ------------------------------------------------------- SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media 100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33 Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift. http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285 |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: core dump during import: 00048, Skip Montanaro |
|---|---|
| Next by Date: | core dump during import: 00048, Skip Montanaro |
| Previous by Thread: | RE: Using sum() within a functioni: 00048, jimcser |
| Next by Thread: | Re: Is there a better way to do this?: 00048, Rob Hooft |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |