I am looking for a method of clustering XYZ data in Python that works on numpy arrays. I know of a few sources, such as clusterpy and Pysal but have had little success with them as they seem to still be in the development stage and do not support numpy arrays.
EDIT:
My numpy arrays are of XY points with a Z column of a value at the point such as soil moisture or plant height. I want to spatially cluster the Z values into similar regions.
-
1I haven't tried it but what about scipy? Also, what problems are you having with what you've tried? PySAL is fairly well established.Fezter– Fezter2014年06月26日 23:36:40 +00:00Commented Jun 26, 2014 at 23:36
-
I am looking for clustering routines that are designed for GIS data, hence the usage of the mentioned libraries. I think clusterpy is completely broken, and Pysal currently only implements the max-p algorithm.asdflkjwqerqwr– asdflkjwqerqwr2014年06月30日 13:49:15 +00:00Commented Jun 30, 2014 at 13:49
1 Answer 1
scikit-learn has an extensive clustering library with many different methods available. As a bonus scikit-learn is one of the best documented Python libraries I've seen. When working with 3d point clouds I've had a lot of success with DBSCAN for instance.
Alternately as @Fezter suggests above, scipy offers two different methods of clustring: k-means (vector-quantization) and hierarchical classification. While there isn't the number of methods available scipy is often a good place to start as the clustering methods don't tend to require as much setup.
-
I am looking for cluster libraries for GIS data, see my edit.asdflkjwqerqwr– asdflkjwqerqwr2014年06月30日 13:51:57 +00:00Commented Jun 30, 2014 at 13:51