ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Mon, 04 Nov 2013 05:18:21 +0100Sum a list of vectorshttps://ask.sagemath.org/question/10658/sum-a-list-of-vectors/I'm given a list of rational vectors, i.e., something like [(1,2,3), (1/2, 4, 5), (-1, 0, 0)], and I need to sum all vectors of this list.
Even though I searched a bit, I cannot find the right sage command for this task. For example, sum() does not seem to work here. At least I couldn't figure out how to apply it to a list of such type.
Of course I could use a loop and an additional variable that saves the partial sums. But there has to be a more elegant way.SamsaMon, 04 Nov 2013 05:18:21 +0100https://ask.sagemath.org/question/10658/