![](https://secure.gravatar.com/avatar/afdaaab755ef79ac9e1374882d60ae9f.jpg?s=120&d=mm&r=g)
I am facing the same problem as well, but can't figure out how the weighting should be done exactly.
Has anybody successfully completed the modification of the code to allow a weighted kde? I am attempting to perform kde on a set of imaging data with X, Y, and an additional "temperature" column.
Performing the kde on only the X,Y axes gives a working heatmap showing the spatial distribution of the data points, but I would also like to use them to see the "temperature" profile (the third axis), much like a geographical heatmap showing temperature or rainfall values over a X-Y map.
I found another set of code from http://pastebin.com/LNdYCZgw which allows weighted kde, but when I tried it out with my data, it took much longer than the normal kde (>1 hour) when the original code took only a about twenty seconds (despite claims that it was faster).
Thanks, Jackson
Here's a modification of the scipy KDE code that I made to perform weighting, as per the earlier discussion. No guarantees as to correctness, but it seems to be right-ish? Zach