Registry / analytics / pointpats

pointpats

JSON →
library2.5.5pypypi✓ verified 86d ago

pointpats provides methods and functions for planar point pattern analysis, including point process simulation, intensity estimation, distance-based statistics, and cluster detection. Version 2.5.5 (current) supports Python 3.11+ and is part of the PySAL ecosystem. Releases follow a minor version cadence, with occasional breaking changes.

pip install pointpats
INSTALL
IMPORT
SIG · POINTPATS
P
pointpats
analyticspythonv2.5.5
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

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

PointPattern
from pointpats import PointPattern
from pointpats.pointpatterns import PointPattern
PointPattern is exported from the top-level pointpats package; old path is obsolete and may not exist.
K
from pointpats import K
from pointpats.statistics import K
K function is in pointpats namespace; submodule path is incorrect.
F
from pointpats import F
G
from pointpats import G
simulate
from pointpats import simulate
from pointpats.simulation import simulate
simulate is a top-level module; old import fails.

Creates a random point pattern and computes Ripley's K function for spatial clustering analysis.

import numpy as np from pointpats import PointPattern, K # Create point pattern (random uniform) np.random.seed(42) points = np.random.uniform(low=0, high=10, size=(50, 2)) pp = PointPattern(points) # Compute Ripley's K function k = K(pp, intervals=20) k.plot() print('Observed K values:', k.statistics[:5])
Debug
Known issues
gotchapointpats requires Python >=3.11. Installing with older Python versions will fail or install an outdated version.
fix
Upgrade Python to 3.11+ or use a virtual environment with correct Python version.
affects: >=2.0.0
gotchaThe 'events' argument in PointPattern is deprecated in favor of 'points'. Using 'events' still works but may be removed in future.
fix
Use 'points' instead of 'events' when creating PointPattern.
affects: >=2.3.0
gotchaWhen using pandas DataFrame as input, the column names must be 'x' and 'y' (case-sensitive) or 'geometry' with a point column.
fix
Ensure DataFrame has columns 'x' and 'y', or pass coordinates as numpy array.
affects: all
gotchaSimulate functions (like PoissonPointProcess) return a PointPattern object, not a raw array. Access points via .points attribute.
fix
Use simulated_pp.points to get the numpy array of coordinates.
affects: all
breakingIn version 2.2.0, the 'window' parameter for PointPattern changed from a bounding box tuple to a shapely object. Old code passing (minx, miny, maxx, maxy) breaks.
fix
Pass window as a shapely Polygon or use import shapely.geometry.box; window = box(minx, miny, maxx, maxy).
affects: >=2.2.0
Errors
Common errors & fixes
AttributeError: module 'pointpats' has no attribute 'pointpatterns'
Importing from deprecated submodule path.
fix
Use 'from pointpats import PointPattern' instead.
ValueError: Must pass a 2D array with shape (n,2).
Input data has wrong shape (e.g., 1D or 3D array).
fix
Ensure points array is 2D with shape (n,2). For single-feature input, reshape: points.reshape(-1,2).
ModuleNotFoundError: No module named 'pointpats'
Package not installed or installed in a different environment.
fix
Run 'pip install pointpats' and verify Python version >=3.11.
AttributeError: 'PointPattern' object has no attribute 'plot'
Trying to call plot on PointPattern directly; plot method is on statistics objects like K, G, F.
fix
Use statistic object (e.g., k = K(pp); k.plot()) or import matplotlib and plot manually.
Upgrade
Version history
2.5.5latest on PyPI · released Feb 23, 2026
Audit
Dependencies
numpyrequiredcore array operations
scipyrequiredspatial distance computations and statistical tests
pandasoptionaldata structure for point coordinates
libpysaloptionalspatial weights and geographic utilities
Agent activity
23 hits · last 30 days
node
20
Amazon
1
OpenAI (training)
1
Resources
pointpats — pip install pointpats · libregistry