Engineering proximity spatial features
In the previous section, we covered summary spatial features that are derived from preexisting spatial relationships. In this section, we’ll be covering proximity spatial features that are derived based on the proximity, or distance, between two or more observations. To calculate these features, let’s import the NYC Airbnb dataset that we’ve worked with previously. To do that, you’ll run the following code cell:
- Import the data:
# Reading in the data
listings = pd.read_csv(data_path + r'NY Airbnb June 2020\listings.csv.gz', compression='gzip', low_memory=False)
# Converting it to a GeoPandas DataFrame
listings_gpdf = gpd.GeoDataFrame(
listings,
geometry=gpd.points_from_xy(listings['longitude'],
&...