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