def vertex_group_data(mesh, index):
    """
    Return vertex group data for each vertex. Vertices not in the group
    get a zero value.

    :param mesh:
    :param index:

    """
    group_data = []
    for vertex in mesh.vertices:
        weight = None
        for group in vertex.groups:
            if group.group == index:
                weight = group.weight
        group_data.append(weight or 0.0)
    return group_data