Find and replace consecutive string values in a list
Don't mutate input and return.

If I need to pass columns unedited to two different functions, than your function will seem like it's not mutating columns and I wouldn't have to perform a copy of the data. But this isn't the case.
You may want to potentially error if there are no values before the first "Unnamed" value.
You may want to make pattern an argument, to allow reusability of the function. And instead use change it to a callback to allow even more reusability.


Overall your function's pretty good. I don't think it can be made much shorter.

def value_or_previous(iterator, undefined, default=None):
    prev_item = default
    for item in iterator:
        if not undefined(item):
            prev_item = item
        yield prev_item


def rename_unnamed(columns):
    return list(value_or_previous(columns, re.compile(r'^Unnamed:\s\d+$').match))