Project 17 · Geospatial analysis

Geospatial Airbnb Analysis in London

✅ published data: 2025

Geospatial analysis of Airbnb accommodation in London using September 2025 data. Prices are compared by location and distance from Charing Cross, and KNN is used to identify nearby properties of the same type and calculate local price references.

Python
Pandas
Plotly
Airbnb
Geospatial
KNN

CONTEXT AND OBJECTIVE

This project analyses how nightly Airbnb accommodation prices vary by location in London. Within the same neighbourhood, properties lie at different distances from the centre and have very different accommodation options around them. Alongside neighbourhood comparisons, the analysis therefore measures distances and uses nearby accommodation prices to describe each area in greater detail.

The Inside Airbnb dataset covers September 2025 and includes the nightly price, accommodation type, neighbourhood, latitude and longitude of each listing. After applying quality and activity criteria, the analysis uses 44,019 properties. Their coordinates make it possible to locate them on the map, measure distances and find comparable accommodation nearby.

Local comparisons involve accommodation of the same type. The price of an entire apartment, for example, is compared with that of other entire apartments nearby. Distance from Charing Cross is also considered to examine how median prices change between central and more distant areas.

PREPARATION AND GEOSPATIAL CRITERIA

LOCATION AND PRICE REPRESENTATION

The first map places listings within the Greater London boundary and colours them by nightly price. To improve readability, this view excludes the highest 1% of prices and uses a logarithmic scale. This exclusion applies only to the visualisation; the other indicators retain the dataset that passed the quality filters.

The second map groups listings into 500-metre distance bands from Charing Cross. Each point takes the colour of the median price for its band, allowing areas to be compared using a representative value rather than an individual listing. The tables provide an additional comparison using one-kilometre intervals.

DISTANCE FROM CENTRAL LONDON

The distance from each accommodation to Charing Cross is calculated from its latitude and longitude using the Haversine method. Expressed in kilometres, it is used to order properties into distance bands from the centre, from the nearest areas to the most distant.

DISTANCE FROM THE CENTRE BY BAND
\underbrace{\text{Charing Cross}}_{\text{centre}}\;\longrightarrow\;\text{0 to 0.5 km}\;\longrightarrow\;\text{0.5 to 1 km}\;\longrightarrow\;\cdots

For each distance band, the median price and number of accommodation listings are calculated. Both values are presented together so prices can be compared alongside the number of properties in each interval.

ANALYSIS AND RESULTS

COMPARABLE GEOGRAPHICAL NEIGHBOURS

The nearest neighbours (KNN) algorithm is used to analyse each property's immediate surroundings. Nearby listings are first identified from their coordinates. For price comparisons, neighbours of the same accommodation type are selected and the listing itself is excluded. Distances are calculated using Haversine and expressed in kilometres.

KNN COMPARISON DIAGRAM
\boxed{\text{Accommodation}}\xrightarrow{\text{KNN}}\boxed{\text{5 comparable neighbours}}\longrightarrow\boxed{\text{Local median}}

The neighbour search provides three indicators describing how close accommodation listings are to one another and how prices are distributed around them.

  • Distance to the nearest neighbour and average distance to the five closest neighbours, to measure accommodation concentration.
  • Median price of five nearby accommodation listings of the same type, as a reference for comparing local supply.
  • Percentage of expensive or cheap listings among the ten neighbours of the same type, based on their relative price classification.

MEDIAN PRICE OF THE SURROUNDING AREA

For each listing, the five closest accommodation listings of the same type are found and their median nightly price is calculated. This provides a reference for nearby supply. The map allows comparisons across areas without relying on a single property's price.

LOCAL PRICE OF FIVE COMPARABLE NEIGHBOURS
P_{\mathrm{local}}=\operatorname{median}(p_1,p_2,p_3,p_4,p_5)

p1 to p5 represent the nightly prices of the five closest accommodation listings of the same type, excluding the listing being analysed.

The map's colour scale is adjusted between the 0.5th and 99.5th percentiles of local medians, reducing the visual influence of a few extreme values. The original median calculated for each accommodation remains available when inspecting its point.

CONCENTRATION OF HIGH PRICES

Listings are classified as cheap, stable or expensive using percentiles calculated within each accommodation type. For each property, the percentage of expensive listings among its ten closest comparable neighbours is calculated. This percentage is displayed on the map using a scale from 0 to 100%.

Two areas with similar local medians may have different percentages of expensive listings because that classification is defined within each accommodation type. The two maps are therefore read together. One retains prices in pounds; the other shows the relative composition of nearby supply.

COMPARISONS BY NEIGHBOURHOOD AND DISTANCE

The tables allow the maps to be compared with figures by area. One presents the fifteen neighbourhoods with the highest median price, together with listing counts and the percentages of expensive and cheap properties. The other shows the same figures by kilometre of distance from Charing Cross, allowing the volume and composition of supply to be compared across bands.

DELIVERABLES AND LESSONS LEARNED

The maps show each listing's price, the median corresponding to its distance from the centre and indicators calculated using neighbouring properties. The tables complete the comparison with accommodation counts and percentages by neighbourhood and distance from Charing Cross.

A neighbourhood median summarises accommodation in locations that may differ substantially. The median of five neighbours of the same type provides a comparison closer to each property, while the percentage of expensive listings among ten neighbours describes the surrounding supply. The results relate to listings published in September 2025.