input: def compress_sequence(nums):
      """ Compress a given data sequence by grouping consecutive elements with the same sign.
      If the product of two consecutive elements is non-negative, they are grouped together.
      If the product is negative, a new group starts.
      >>> compress_sequence([9, -2, 6, 0, -7])
      [[9], [-2, 6, 0], [-7]]
      >>> compress_sequence([1, 2, -3, -4, 5])
      [[1, 2], [-3, -4], [5]]
      """
      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
output:     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