input: Write a function to compress a given data sequence such that consecutive numbers with the same sign are grouped together. The function should return a list of lists where each sublist contains consecutive elements with the same sign. The function should handle sequences with both positive and negative numbers, as well as zeros.
  
  def compress_sequence(nums):
      output = []
      temp = []
  
      for i in range(1, len(nums)):
          if nums[i-1] * nums[i] >= 0:
              temp.append(nums[i-1])
          else:
              temp.append(nums[i-1])
              output.append(temp)
              temp = []
      temp.append(nums[i])
      output.append(temp)
  
      return output
  
  assert compress_sequence([9, -2, 6, 0, -7])==[[9], [-2], [6, 0], [-7]]
  assert compress_sequence([1, 2, -3, -4, 5])==[[1, 2], [-3, -4], [5]]
  assert compress_sequence([0, 0, 0, 0, 0])==[[0, 0, 0, 0, 0]]
  assert compress_sequence([])==[]
output: def compress_sequence(nums):
      output = []
      temp = []
  
      for i in range(len(nums)):
          if temp and (nums[i] * temp[-1] < 0 or (nums[i] == 0 and temp[-1] != 0)):
              output.append(temp)
              temp = []
          temp.append(nums[i])
      
      if temp:
          output.append(temp)
  
      return output