Calculating Point Density using Python

I have a list of X and Y coordinates from geodata of a specific part of the world. I want to assign each coordinate, a weight, based upon where it lies in the graph.

For Example: If a point lies in a place where there are a lot of other nodes around it, it lies in a high density area, and therefore has a higher weight.

The most immediate method I can think of is drawing circles of unit radius around each point and then calculating if the other points lie within in and then using a function, assign a weight to that point. But this seems primitive.

I’ve looked at pySAL and NetworkX but it looks like they work with graphs. I don’t have any edges in the graph, just nodes.

Best answer

A standard solution would be using KDE (Kernel Density Estimation).
Search on web: “KDE Estimation” you will find enormous links.
in Google type: KDE Estimation ext:pdf
Also, Scipy has KDE, follow this There is working example codes there 馃槈