So I am trying to figure out how to understand the Getis Ord results from pysal.

I have a geographically enabled datatframe, and I want to figure out how to find both hot and cold spots from the results.

import pysal

fc = r"C:\temp\towns.shp"
field = "TOTALPOP10"
sdf_poly = SpatialDataFrame.from_featureclass(fc) # polygon

permutationsValue = 999
w_poly = pysal.weights.Queen.from_dataframe(df=sdf_poly, geom_col='SHAPE')
y = sdf_poly[field]
statistics_g = G_Local(y, w_poly,
                     star=True, transform='R', permutations=permutationsValue)

This all works fine and well, now I need to find significant values:

sig = statistics_g.p_sim<0.05

Are these the hots zones?

If so, how do I find the cold spots as well?


To determine hotspots and coldspots, you first need to see globally if there exists some form of autocorrelation/clustering (Global Moran's I).

Then, you could do local statistics to determine local clusters like you did above.

  1. To determine hotspots: Low p-values (significant) areas with Positive z-scores.
  2. To determine coldspots: Low p-values (significant) areas with negative z-scores.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.