[Python] How to do Moran's I for set of coordinates with space inbetween?

Discussão em 'Python' iniciado por Stack, Novembro 26, 2025.

  1. Stack

    Stack Membro Participativo

    I have a point pattern consisting of a set of coordinates in a 2D space each belonging to a category (e.g., red, gren, blue) and I want to use Moran's I to test how these categories are represented spatially.

    To do this I'm using PySAL and following the example from the answer in this post. My issue is that my data originally consists of just a set of coordinates and associated categories, whereas this method requires a matrix.

    I tried to solve this by setting up a matrix corresponding to each point in the 2D plane, with blank spaces as 0 and points as corresponding to their category (here values from 1-12). However, when I do this, I believe the analysis also includes all the 0 values which completely skews the picture.

    What is the smart way to go about this?

    Continue reading...

Compartilhe esta Página