Local Moran's I
local_morans_i(gdf, column, weight_type='queen', k=4, permutations=999)
Execute Local Moran's I calculation for the data.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
gdf |
GeoDataFrame
|
The geodataframe that contains the data to be examined with local morans I. |
required |
column |
str
|
The column to be used in the analysis. |
required |
weight_type |
Literal[queen, knn]
|
The type of spatial weights matrix to be used. Defaults to "queen". |
'queen'
|
k |
int
|
Number of nearest neighbors for the KNN weights matrix. Defaults to 4. |
4
|
permutations |
int
|
Number of permutations for significance testing. Defaults to 999. |
999
|
Returns:
Type | Description |
---|---|
GeoDataFrame
|
Geodataframe appended with two new columns: one with Local Moran's I statistic and one with p-value for the statistic. |
Raises:
Type | Description |
---|---|
EmptyDataFrameException
|
The input geodataframe is empty. |
Source code in eis_toolkit/exploratory_analyses/local_morans_i.py
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
|