# Point Pattern Analysis (pointpats)

Statistical analysis of planar point patterns in Python.

pointpats is an open-source library for the analysis of planar point patterns and a subpackage of the Python Spatial Analysis Library, PySAL.

## Key workflows (notebooks)

Explore the main workflows through executable notebooks:

###### Centrography

Centroids, dispersion measures, and visual summaries.

###### Quadrat statistics

Grid-based summaries and tests for spatial randomness.

###### Distance-based statistics

G, K, and L functions, envelopes, and interaction structure.

## Quickstart

Install the latest release:

    pip install pointpats

or using conda-forge:

    conda install -c conda-forge pointpats

A minimal example:

    import numpy as np
    from pointpats import PointPattern

    # toy coordinates
    coords = np.random.random((100, 2))
    pp = PointPattern(coords)

    print("n:", pp.n)
    print("mean center:", pp.mean_center)
    print("average nearest-neighbor distance:", pp.nnd.mean())

## What you can do with `pointpats`

- Build and summarize point pattern objects from coordinate data.

- Compute centrographic measures (mean center, standard distance, ellipses).

- Perform quadrat statistics for tests of complete spatial randomness.

- Use distance-based functions (G, K, L) and simulation envelopes.

- Work with marked patterns and simulated point processes.

## User Guide

The full user guide is organized around executable notebooks:

User Guide

- User Guide

## Part of the PySAL ecosystem

`pointpats` is part of the PySAL family of spatial analysis libraries, alongside components for spatial weights, regression, clustering, and more.

- Source code: https://github.com/pysal/pointpats

- Bug reports and feature requests: https://github.com/pysal/pointpats/issues

## Citation

If you use `pointpats` in your work, please cite the Zenodo record:

    @software{wei_kang_2023_7706219,
      author    = {Wei Kang and Levi John Wolf and Sergio Rey and Hu Shao
                   and Mridul Seth and Martin Fleischmann and Sugam Srivastava
                   and James Gaboardi and Giovanni Palla and Dani Arribas-Bel
                   and Qiusheng Wu},
      title     = {pysal/pointpats: pointpats 2.3.0},
      year      = {2023},
      publisher = {Zenodo},
      version   = {v2.3.0},
      doi       = {10.5281/zenodo.7706219},
      url       = {https://doi.org/10.5281/zenodo.7706219}
    }