input: Write a function to compress a given data sequence by grouping consecutive numbers with the same sign (positive or negative) together. If the given data sequence is empty, return an empty list.
  
  def compress_sequence(nums):
      output = []
      temp = []
  
      if not nums:
          return output
  
      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, -6, -7])==[[1, 2, 3, 4], [-5, -6, -7]]
  assert compress_sequence([-1, -2, -3, -4, 5, 6, 7])==[[-1, -2, -3, -4], [5, 6, 7]]
  assert compress_sequence([0, 0, 0, 0, 0])==[[0, 0, 0, 0, 0]]
  assert compress_sequence([])==[]
output: def compress_sequence(nums):
      output = []
      temp = []
  
      if not nums:
          return output
  
      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[-1])
      output.append(temp)
  
      return output