A

Admin • 833K Points
Coach

Q. For a 2D array, what does np.sum(arr, axis=0) do?

  • (A) Sums the elements across each row
  • (B) Sums the elements down each column
  • (C) Sums all elements in the array
  • (D) Returns the number of rows
  • Correct Answer - Option(B)
  • Views: 27
  • Filed under category Numpy
  • Hashtags:

Explanation by: Admin

When axis=0 is specified, np.sum() computes the sum down each column of the 2D array.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.