PySAL: Example Data Sets

PySAL comes with a number of example data sets that are used in some of the documentation strings in the source code. All the example data sets can be found in the examples directory.


Polygon shapefile for Albuquerque New Mexico.

  • 10740.dbf: attribute database file
  • 10740.shp: shapefile
  • 10740.shx: spatial index
  • queen contiguity GAL format
  • rook contiguity GAL format


Synthetic data to illustrate spatial weights. Source: Anselin, L. and S.J. Rey (in progress) Spatial Econometrics: Foundations.

  • rook contiguity for regular lattice
  • book.txt: attribute data for regular lattice


Employment density for California counties. Source: Anselin, L. and S.J. Rey (in progress) Spatial Econometrics: Foundations.

  • calempdensity.csv: data on employment and employment density in California counties.


Chicago Community Areas (n=77). Source: Anselin, L. and S.J. Rey (in progress) Spatial Econometrics: Foundations.

  • Chicago77.dbf: attribute data
  • Chicago77.shp: shapefile
  • Chicago77.shx: spatial index


Example data for autocorrelation analysis. Source: de Smith et al (2009) Geospatial Analysis (Used with permission)

  • desmith.txt: attribute data for 10 spatial units
  • spatial weights in GAL format


Cardiff juvenile delinquent residences.

  • juvenile.dbf: attribute data
  • juvenile.html: documentation
  • juvenile.shp: shapefile
  • juvenile.shx: spatial index
  • juvenile.gwt: spatial weights in GWT format


State regional income Mexican states 1940-2000. Source: Rey, S.J. and M.L. Sastre Gutierrez. “Interregional inequality dynamics in Mexico.” Spatial Economic Analysis. Forthcoming.

  • mexico.csv: attribute data
  • spatial weights in GAL format


Small test shapefile

  • rook31.dbf: attribute data
  • spatia weights in GAL format
  • rook31.shp: shapefile
  • rook31.shx: spatial index


1998 and 2001 Zip Code Business Patterns (Census Bureau) for Sacramento MSA

  • sacramento2.dbf
  • sacramento2.sbn
  • sacramento2.sbx
  • sacramento2.shp
  • sacramento2.shx


Sample Shapefiles used only for testing purposes. Each example include a “.shp” Shapefile, “.shx” Shapefile Index, “.dbf” DBase file, and a “.prj” ESRI Projection file.

Examples include:

  • Point: Example of an ESRI Shapefile of Type 1 (Point).
  • Line: Example of an ESRI Shapefile of Type 3 (Line).
  • Polygon: Example of an ESRI Shapefile of Type 5 (Polygon).


North Carolina county SIDS death counts and rates

  • sids2.dbf: attribute data
  • sids2.html: documentation
  • sids2.shp: shapefile
  • sids2.shx: spatial index
  • GAL file for spatial weights


Homicides and selected socio-economic characteristics for counties surrounding St Louis, MO. Data aggregated for three time periods: 1979-84 (steady decline in homicides), 1984-88 (stable period), and 1988-93 (steady increase in homicides). Source: S. Messner, L. Anselin, D. Hawkins, G. Deane, S. Tolnay, R. Baller (2000). An Atlas of the Spatial Patterning of County-Level Homicide, 1960-1990. Pittsburgh, PA, National Consortium on Violence Research (NCOVR).

  • stl_hom.html: Metadata
  • stl_hom.txt: txt file with attribute data
  • stl_hom.wkt: A Well-Known-Text representation of the geometry.
  • stl_hom.csv: attribute data and WKT geometry.
  • GAL file for spatial weights

US Regional Incomes

Per capita income for the lower 48 US states, 1929-2010

  • us48.shp: shapefile
  • us48.dbf: dbf for shapefile
  • us48.shx: index for shapefile
  • usjoin.csv: attribute data (comma delimited file)


Virginia Counties Shapefile.

  • virginia.shp: Shapefile
  • virginia.shx: shapefile index
  • virginia.dbf: attributes
  • virginia.prj: shapefile projection