How can I add column values in a two dimenstional array? For example
[[11.9, 12.2, 12.9],
[15.3, 15.1, 15.1],
[16.3, 16.5, 16.5],
[17.7, 17.5, 18.1]]
I want it to result to:
[61.2,61.3,62.6]
I have tried this so far:
Btotals.append(sum(float(x)) for x in zip(totals))
However it gave me this:
[<generator object <genexpr> at 0x02A42878>]
numpyfor this? Withnumpyit would be:numpy.sum(a, axis=0).