code: def last_item(array):
      
      if array.size == 0:
          # work around for https://github.com/numpy/numpy/issues/5195
          return []
  
      indexer = (slice(-1, None),) * array.ndim
      return np.ravel(array[indexer]).tolist()
docs: Returns the last item of an array in a list or an empty list.