Given an unsorted integer array, find the first missing positive integer
PEP8

Python uses underscore as naming separator in function and variable names, see PEP8

Naming

for i,v in enumerate(nums)


It's better to use some obvious names so instead of i,v you should use index, value

Improvements

You've got a right idea on how to solve this, but there are some minor things in your implementation that can be improved.

for i,v in enumerate(nums):
    if v &gt; len(nums):
        nums[i]=-1
    elif v &lt;= 0:
        nums[i]=-1
    else:


this part can be simplified to

if  0 &gt;= value &gt; len(nums):
    continue


Now your while loop can make infinite number of cycles on such list [3,4,3,-1] so you need to handle this, also you don't have to replace items that are &lt;= 0 or items that are &gt;= len(nums) with -1 you can just skip them.

So in the end your code should look like this:

def first_missing_positive(nums):
    """
    :type nums: List[int]
    :rtype: int
    """
    if not nums:
        return 1
    for index, value in enumerate(nums):
        if len(nums) &lt; value &lt;= 0:
            continue
        while index + 1 != nums[index] and 0 &lt; nums[index] &lt;= len(nums):
            v = nums[index]
            nums[index], nums[v-1] = nums[v-1], nums[index]
            nums[v-1] = v

            # Don't create infinite loops
            if nums[index] == nums[v-1]:
                break

    for index, value in enumerate(nums, 1):
        if value != index:
            return index
    return len(nums) + 1