input: Write a function to compress a given data sequence by grouping consecutive numbers with the same sign (either positive or negative) together. If the data sequence is empty, return an empty list. If the sequence contains only one number, return a list containing that single number.
  def compress_sequence(nums):
      if not nums:
          return []
      if len(nums) == 1:
          return [nums]
  
      output = []
      temp = [nums[0]]
  
      for i in range(1, len(nums)):
          if nums[i] * nums[i-1] >= 0:
              temp.append(nums[i])
          else:
              output.append(temp)
              temp = [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]) == [[1, 2, 3]]
  assert compress_sequence([-1, -2, -3]) == [[-1, -2, -3]]
  assert compress_sequence([]) == []
  assert compress_sequence([0]) == [[0]]
output: def compress_sequence(nums):
      if not nums:
          return []
      if len(nums) == 1:
          return [nums]
  
      output = []
      temp = [nums[0]]
  
      for i in range(1, len(nums)):
          if nums[i] * nums[i-1] >= 0:
              temp.append(nums[i])
          else:
              output.append(temp)
              temp = [nums[i]]
      output.append(temp)
  
      return output