要生成一个3*4的数组,并计算数组中偶数值之和,Python代码是?( )
import numpy as np
arr = np.array([[1,2,3,4],[5,6,7,8],[9,10,11,12]])
np.sum(arr[arr%2==0])
import numpy as np
arr = np.array([[1,2,3,4],[5,6,7,8],[9,10,11,12]])
np.sum(arr[:,arr%2==0])
import numpy as np
arr = np.array([[1,2,3,4],[5,6,7,8],[9,10,11,12]])
np.sum(arr[np.get(arr%2==0)])
import numpy as np
arr = np.array([[1,2,3,4],[5,6,7,8],[9,10,11,12]])
np.sum(arr[arr.even()])