How do I add up all of the values of a column in a python array? Ideally I want to do this without importing any additional libraries.
input_val = [[1, 2, 3,
Using Numpy you can easily solve this issue in one line:
1: Input
input_val = [[1, 2, 3, 4, 5], [1, 2, 3, 4, 5], [1, 2, 3, 4, 5]]
2: Numpy does the math for you
np.sum(input_val,axis=0)
3: Then finally the results
array([ 3, 6, 9, 12, 15])