A

Admin • 832.27K Points
Coach

Q. How do you select all rows of a 2D NumPy array where column 0 is greater than 5?

  • (A) arr[arr[:,0]>5]
  • (B) arr[0]>5
  • (C) arr[arr>5, 0]
  • (D) arr[arr>5][:,0]
  • Correct Answer - Option(A)
  • Views: 11
  • Filed under category Numpy
  • Hashtags:

Explanation by: Admin

arr[:,0] selects column 0, and arr[arr[:,0]>5] filters rows where column 0 > 5.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.