Questions tagged [pysal]

Pysal is a spatial analysis library written in Python. It provides a variety of functions for interpreting common spatial data file formats and performing common analyses on them, with the goal of being easy to providing core functionality that is easier to integrate into higher level projects.

Pysal is an open-source library of spatial data analysis tools written in Python. It is able to read a variety of common data file formats such as shapefiles, DBF, CSV, WKT, GeoDa, GAL, GWT, and files from popular programs such as ArcGIS, MATLAB, and Stata. It provides functions for assessing autocorrelation, spatial econometrics, analyzing spatial data over time and more.

68 questions
0
votes
0 answers

Error when calculating morphological tessellation cells with momepy library

"Momepy is a library for quantitative analysis of urban form - urban morphometrics. It is part of PySAL (Python Spatial Analysis Library) and is built on top of GeoPandas, other PySAL modules and networkX." momepy documentation Using code (relevant…
matthiett
  • 1
  • 4
0
votes
0 answers

Warning when loading pysal library

I dowloaded Anaconda e installed Pysal through the nqvigator. It seems to work properly, but when loading it, the following warning appears: UserWarning: The `dill` module is required to use the sqlite backend fully. from .sqlite import…
Oalvinegro
  • 458
  • 5
  • 21
0
votes
1 answer

impute NaN with neighbors' average for a geopandas dataframe

I have a geopandas dataframe where there are NaN in a column. I want to impute the NaN with the average value of its neighbors. I made up the following example and would appreciate it if somebody can help me out with the final steps. Thanks. # Load…
Neo
  • 482
  • 5
  • 17
0
votes
1 answer

Using categorical variable in spreg models

I would like to employ a spatial regression model, using the spreg package in Python. My data consists of numeric variables, but I also have a categorical land cover variable (with 7 classes) that I need to include in the model. This works perfectly…
0
votes
1 answer

Hvplot AttributeError: 'list' object has no attribute 'xy'

I have trouble making a interactive map with PySAL. I want to visualize the dutch 'gemeente' (Municipalities). You can download shape files from the dutch bureau of statistics:…
Simsa
  • 3
  • 3
0
votes
0 answers

Getting "AttributeError: 'numpy.ndarray' object has no attribute 'transform'" from esda.Moran

Trying to get Moran's I. A test but getting "AttributeError: 'numpy.ndarray' object has no attribute 'transform'" because of the last line of code. Both of the variables are arrays and they look like this: 0 1024.798431 1 859.662720 2 …
Lucas Ian
  • 25
  • 1
  • 5
0
votes
1 answer

Pysal issue module has no attribute 'open'

I have an issue with the 'Pysal' library. I can successfully install Pysal and import it. However, whenever I use the function of Pysal , for example, opening a file by using 'open', then I will get an issue and it shows that 'module 'pysal' has no…
Vera
  • 1
0
votes
1 answer

can't open a shape file with pysal

i try to open a file using pysal wth that code: import pysal f=pysal.open() and this the the response taht I get: AttributeError: module 'pysal' has no attribute 'open' What Im doing wrong?
0
votes
1 answer

Kernel weights based on distance in pysal

I would like to create a distance based spatial weights matrix in pysal that is later fed into the spatial regression methods of the "spreg" submodule of pysal. The following is a small reproducible code example: import numpy as np import…
user823
  • 265
  • 2
  • 14
0
votes
1 answer

Pysal OLS function can not show summary output

I tried PYSAL library in python for Basic OLS method, I followed official documentation from pysal library and for some reason summary for OLS can be shown it says 'str' object has no attribute 'summary' YVar='cena' XVars = ["km", "stari",…
Thomas Kyle
  • 101
  • 1
  • 8
0
votes
1 answer

Suddenly, Probit doesn't work on PySAL (1.14.4)

Up until last week, I had a piece of code for calculating the odds of something occurring for a series of events, but starting this week the code doesn't work. The code is the following: import numpy as np import pysal import os dbf =…
0
votes
1 answer

return the total number of neighbors by using pysal's weights object

I construct a weights object: import pysal as ps neighbors = {0: [3, 1], 1: [0, 2, 2], 2: [1, 2], 3: [0, 1, 1]} weights = {0: [1, 1], 1: [1, 1, 1], 2: [1, 1], 3: [1, 1, 1]} w = ps.W(neighbors, weights) Weights object in pysal has a neighbors…
steven
  • 2,130
  • 19
  • 38
0
votes
1 answer

For loops to a adjacency matrix in python

I need to do for loops to adjacency matrix in python. My goal is to find the first and second order of neighbours in matrix. I did the matrix with pysal queen contiguity. 1 is neighbour, 0 isn´t a neighbour.Code: import pandas as pd import pysal as…
0
votes
2 answers

problems with shapefile output - fiona

I'm using Fiona to write a shapefile containing geometries of US Census congressional districts and census tracts with some computed attributes. Unfortunately, my file is being outputted blank. I am able to see the records in QGIS but not the…
0
votes
1 answer

parallel processing - nearest neighbour search using pysal python?

I have this data frame df1, id lat_long 400743 2504043 (175.0976323, -41.1141412) 43203 1533418 (173.976683, -35.2235338) 463952 3805508 (174.6947496, -36.7437555) 1054906 3144009 (168.0105269, -46.36193) 214474 3030933…
ds_user
  • 2,139
  • 4
  • 36
  • 71