%matplotlib inline import pysal as ps import numpy as np db = ps.open(ps.examples.get_path('columbus.dbf')) db.header ew = db.by_col('EW') ew[:5] from pysal.contrib.viz import mapping as maps maps.plot_choropleth(ps.examples.get_path('columbus.shp'), np.array(ew), 'unique_values') block = ps.weights.regime_weights(ew) cont = ps.queen_from_shapefile(ps.examples.get_path('columbus.shp')) from IPython.display import HTML HTML('') w = ps.weights.Wsets.w_intersection(cont, block) w