Registry / data / esda
library2.9.0pypypi✓ verified 86d ago

esda is a Python library implementing methods for exploratory spatial data analysis, part of the PySAL family. It provides global and local spatial autocorrelation statistics (Moran's I, Geary's C, Getis-Ord G, etc.), spatial correlograms, and shape-based measures. Current version is 2.9.0, requires Python >=3.11. Releases follow a monthly-to-quarterly cadence, with active maintenance.

pip install esda
INSTALL
IMPORT
SIG · ESDA
E
esda
datapythonv2.9.0
Install
16.9s avg
Import
5569ms
Disk
515MB
Pass rate
5/ 10
Env Coverage5 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v2.7.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.910 runs
build_error
glibc
py 3.103.910 runs
installs and imports cleanly · install 16.9s · import 5.569s · 504MB
515MB installed
● package 515MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Moran
from esda import Moran
Moran_Local
from esda import Moran_Local
from esda.moran import Moran_Local
Moran_Local is directly importable from esda since v2.0.
Geary
from esda import Geary
Getis_Ord_G
from esda import Getis_Ord_G

Compute Global Moran's I with a K-nearest neighbors weight matrix.

import libpysal from esda import Moran import numpy as np # Generate random data and a spatial weights matrix np.random.seed(123) y = np.random.random(100) w = libpysal.weights.KNN(k=5, ids=np.arange(100)) # Compute Global Moran's I mi = Moran(y, w) print(f"Moran's I: {mi.I:.3f}, p-value: {mi.p_sim:.3f}") # Output: Moran's I: -0.022, p-value: 0.632
Debug
Known issues
breakingIn esda>=2.5, shapely>=2 is required and pygeos is no longer supported. Upgrade shapely or pin shapely<2.
fix
pip install shapely>=2 or ensure you have a compatible version.
affects: >=2.5.0
gotchaMoran_Local (Local Moran's I) uses a randomization-based p-value by default. For analytical p-values, set `permutations=0` when constructing the object.
fix
moran_local = Moran_Local(y, w, permutations=0)
affects: all
gotchaThe `spatial_lag` function is not a separate function; use `libpysal.weights.lag_spatial(w, y)` instead.
fix
import libpysal; lag = libpysal.weights.lag_spatial(w, y)
affects: all
deprecatedThe `assuncao_rate` function is deprecated since version 2.5. Please use `esda.rate_smoothing.assuncao_rate` instead.
fix
from esda.rate_smoothing import assuncao_rate
affects: >=2.5.0
gotchaWhen using `Moran_Local.plot()` or `Moran_Local.scatterplot()`, ensure matplotlib is installed. These are available since v2.7.
fix
pip install matplotlib
affects: >=2.7.0
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'esda.moran'
Trying to import Moran_Local from the wrong submodule.
fix
Use `from esda import Moran_Local` instead of `from esda.moran import Moran_Local`.
ValueError: The weights matrix is not row-standardized.
Moran class expects row-standardized weights by default.
fix
Use `w.transform = 'R'` before passing to Moran, or create weights with row-standardization (e.g., `libpysal.weights.KNN(..., transform='R')`).
AttributeError: 'Moran' object has no attribute 'I'
The object was not created correctly; perhaps `y` is not numeric or `w` is invalid.
fix
Ensure `y` is a 1D numeric array and `w` is a properly initialized libpysal weights object.
Upgrade
Version history
2.9.0latest on PyPI · released Mar 20, 2026
Audit
Dependencies
libpysalrequiredProvides spatial weights (W) and core spatial data structures.
scipyrequiredUsed for statistical distributions and randomizations.
numpyrequiredCore array operations.
shapelyoptionalRequired for geometric operations in shape and map_comparison modules.
pandasoptionalUsed for data handling in some utilities.
Agent activity
4 hits · last 30 days
node
4
Resources
esda — pip install esda · libregistry