input: Write a function to compress a given data sequence by grouping together consecutive numbers that have the same sign (positive or negative) and are separated by zeros. If a sequence is empty, return an empty list.
  
  def compress_sequence(nums):
      if not nums:
          return []
      output = []
      temp = [nums[0]]
  
      for i in range(1, len(nums)):
          if nums[i] != 0 and (nums[i-1] * nums[i] >= 0):
              temp.append(nums[i])
          else:
              if temp:
                  output.append(temp)
                  temp = []
              if nums[i] != 0:
                  temp.append(nums[i])
      if temp:
          output.append(temp)
      return output
  
  assert compress_sequence([9, -2, 6, 0, -7])==[[9], [-2], [6], [-7]]
  assert compress_sequence([0, 1, 2, -3, -4, 5, 0])==[[1, 2], [-3, -4], [5]]
  assert compress_sequence([0, 0, 0, 1, -1, 0, 2, 3])==[[1], [-1], [2, 3]]
  assert compress_sequence([1, 2, 3, 4, 5])==[[1, 2, 3, 4, 5]]
  assert compress_sequence([])==[]
output: 
  def compress_sequence(nums):
      if not nums:
          return []
      output = []
      temp = [nums[0]]
  
      for i in range(1, len(nums)):
          if nums[i] != 0 and (nums[i-1] * nums[i] >= 0):
              temp.append(nums[i])
          else:
              if temp:
                  output.append(temp)
                  temp = []
              if nums[i] != 0:
                  temp.append(nums[i])
      if temp:
          output.append(temp)
      return output
  