[Python ] Python
sum()
sum() :
sum(iterable[, start])
sum
htl666
190***[email protected]
import numpy as np a = np.array([[1,2],[3,4]]) # print(np.sum(a, axis=1, keepdims=True)) # print(np.sum(a, axis=1))
array([[3], [7]]) array([3, 7])
prometheus
zjg***@163.com
lst = [[1, 2], [3, 4]] print(sum(lst, [])) #[1, 2, 3, 4]
sum() 00
htl666
190***[email protected]
htl666
190***[email protected]
prometheus
zjg***@163.com
sum()
sum() 00
prometheus
zjg***@163.com