Skip to content
This repository has been archived by the owner on Jul 9, 2024. It is now read-only.

Commit

Permalink
stop aliasing pysal
Browse files Browse the repository at this point in the history
  • Loading branch information
ljwolf committed Jul 14, 2018
1 parent 69e5628 commit 79969d4
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions spvcm/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import numpy as np
from numpy import linalg as nla
from scipy.sparse import linalg as spla
import pysal as ps
import pysal
import scipy.linalg as scla
from warnings import warn as Warn

Expand Down Expand Up @@ -56,7 +56,7 @@ def south(df=False):
and the dataframe contains the raw dataset
"""
import geopandas
data = geopandas.read_file(ps.examples.get_path('south.shp'))
data = geopandas.read_file(pysal.examples.get_path('south.shp'))
data = data[data.STATE_NAME != 'District of Columbia']
X = data[['GI89', 'BLK90', 'HR90']].values
N = X.shape[0]
Expand All @@ -66,12 +66,12 @@ def south(df=False):

Y = data.DNL90.values.reshape(-1,1)

W2 = ps.queen_from_shapefile(ps.examples.get_path('us48.shp'),
W2 = pysal.queen_from_shapefile(pysal.examples.get_path('us48.shp'),
idVariable='STATE_NAME')
W2 = ps.w_subset(W2, ids=data.STATE_NAME.unique().tolist()) #only keep what's in the data
W1 = ps.queen_from_shapefile(ps.examples.get_path('south.shp'),
W2 = pysal.w_subset(W2, ids=data.STATE_NAME.unique().tolist()) #only keep what's in the data
W1 = pysal.queen_from_shapefile(pysal.examples.get_path('south.shp'),
idVariable='FIPS')
W1 = ps.w_subset(W1, ids=data.FIPS.tolist()) #again, only keep what's in the data
W1 = pysal.w_subset(W1, ids=data.FIPS.tolist()) #again, only keep what's in the data

W1.transform = 'r'
W2.transform = 'r'
Expand Down Expand Up @@ -99,7 +99,7 @@ def baltim(df=False):
dataframe contains the raw data of the baltimore example
"""
import geopandas
baltim = geopandas.read_files(ps.examples.get_path('baltim.shp'))
baltim = geopandas.read_files(pysal.examples.get_path('baltim.shp'))
coords = baltim[['X', 'Y']].values
Y = np.log(baltim.PRICE.values).reshape(-1,1)
Yz = Y - Y.mean()
Expand Down

0 comments on commit 79969d4

Please sign in to comment.