Setting UV's of a mesh with an array of vertex coordinates
Does the order of UVs in your array match the order of vertices in the mesh? If so, for every loop you assign it's uv based on the its vertex index.
ob.data.uv_layers.active.data[loop.index].uv =( data[loop.vertex_index][0],  data[loop.vertex_index][1])
To clarify, as far as I remember, each face has a loop per vertex - this allows you to have multiple normals/uvs per vertex. In your case you only need a single uv per vertex, which can be achieved by setting the same uv value to each loop that corresponds to the same vertex.
Answer based on Get/Set coordinates for UV vertices using Python