code: def non_zero_index(arr):
      
      for index, row in enumerate(arr):
          if non_zero_row(row):
              return index
      raise ValueError('No non-zero values')
docs: Raises:
          ValueError: If no-non-zero rows can be found.
  
          0.  Empty array raises.
  
              >>> arr = array([])
              >>> non_zero_index(arr)
  
          1.  Array with zero values raises.
  
              >>> arr = array([
              ...     [0, 0],
              ...     [0, 0],
              ...     [0, 0, 0],
              ... ])
              >>> non_zero_index(arr)
  
          2.  Array with a non-zero value will have that index returned.
  
              >>> arr = array([
              ...     [0, 0],
              ...     [0, 0, 0],
              ...     [1, 0, 0],  # Still has zeros
              ...     [1, 1, 0],
              ...     [0, 1, 1],
              ...     [-1, 0, 0],
              ...     [-1, 2, 3],  # First non-zero array
              ...     [1, 2, 3],
              ... ])
              >>> non_zero_index(arr)
  
              6
  
          :param arr: array
          :type arr: numpy array
          :return index: Index of first non-zero entry in an array.
          :rtype index: int