'How do I sum the content of a list containing numpy arrays?

Consider the following code:

arr = np.array([1, 2, 32, 3, 3])

list1 = arr.tolist()
print(list1)
[1, 2, 32, 3, 3]

I want to create a sum of the entire content to get the following output

list_sum=[41]

Is there an elegant way to quickly do this?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source