GeoDaCenter / pygeoda

pygeoda is a python library for spatial data analysis based on C++ libgeoda
GNU General Public License v3.0
36 stars 5 forks source link

pygeoda

PyPI version PyPI - Downloads Anaconda-Server Badge Anaconda-Server Badge

pygeoda is a python library for spatial data analysis based on libgeoda and GeoDa. It provides spatial data analysis functionalities including Exploratory Spatial Data Analysis, Spatial Cluster Detection and Clustering Analysis, Regionalization, etc. based on the C++ source code of GeoDa, which is an open-source software tool that serves as an introduction to spatial data analysis.

Installation

To install from PyPi:

pip install pygeoda

To install with conda run:

conda install -c conda-forge pygeoda 

To install from source: (See more details: https://geodacenter.github.io/pygeoda/install.html)

pip install git+https://github.com/geodacenter/pygeoda    

Documentation

https://geodacenter.github.io/pygeoda

Citation

Anselin, L., Li, X. and Koschinsky, J. (2022), GeoDa, From the Desktop to an Ecosystem for Exploring Spatial Data. Geogr Anal, 54: 439-466. Download Citation

Quick Start

import geopandas
df = geopandas.read_file('./data/Guerry.shp')

import pygeoda
gda = pygeoda.open(df)
w = pygeoda.queen_weights(gda)
lisa = pygeoda.local_moran(w, gda['Crm_prs'])
#lisa object:
#    lisa_values(): [0.516120231288079, 0.8182751384950308, ...]
#    lisa_pvalues(): [0.197, 0.013, ...]
#    lisa_num_nbrs(): [4, 6, ...]
#    lisa_clusters(): [0, 1, ...]
#    lisa_labels(): ('Not significant', 'High-High', 'Low-Low', 'High-Low', 'Low-High', 'Undefined', 'Isolated')
#    lisa_colors(): ('#eeeeee', '#FF0000', '#0000FF', '#a7adf9', '#f4ada8', '#464646', '#999999')

Current version 0.0.8

Authors

Xun Li and Luc Anselin

Contributors

Guanpeng Dong; Yong Liu; Hang Zhang; Yeqing Han;