input: def compress_sequence(nums):
      """
      Compress a given data sequence by grouping consecutive numbers that have the same sign.
      If two consecutive numbers have the same sign, they are grouped together. If they have opposite signs, they are separated into different groups.
      The function returns a list of lists, where each sublist contains numbers of the same sign.
  
      >>> compress_sequence([9, -2, 6, 0, -7])
      [[9], [-2], [6, 0], [-7]]
      """
output:     result = []
      current_group = [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):
              current_group.append(nums[i])
          else:
              result.append(current_group)
              current_group = [nums[i]]
      
      result.append(current_group)
      return result