[SciPy-user] Remove duplicate points from xyz data.

Dharhas Pothina Dharhas.Pothina@twdb.state.tx...
Thu Feb 19 11:09:10 CST 2009


Hi,

I've been trying to use the cookbook instructions for plotting irregular data and from what I can tell the delaunay triangulation is failing because my dataset has duplicate points.

I tried to follow PierreGM's technique for removing duplicate points from an archived discussion:

> For example:
> z=np.array([[1,1],[1,2],[1,2],[1,3]])
> zr=z.view([('a',int),('b',int)])
> zs = numpy.unique(zr).view((int,2))

And I can use this to remove duplicate x,y points but I'm unclear how to remove the corresponding z values.

To be clear. I have three arrays x,y,z . I need to remove rows that have duplicate (x,y) coordinates. These rows may or may not have the same z values in them.

- dharhas
ps. Once I get this working is there a way to update the cookbook page to indicate that duplicate points need to be removed before it will work. 


More information about the SciPy-user mailing list