def swap_empty_string_for_none(array):
    """ replace empty string fields with None """

    def swap(value):
        """ change empty string to None """
        if value == "":
            return None

        else:
            return value

    return [swap(x) for x in array]