Analysis
Getting from a raw download to something you can put in front of someone.
This is the largest section on the site, and it is all one thing: getting from a raw download to something you can put in front of someone. Clean, join, aggregate, map.
The code for all four steps is short. The decisions underneath are the analysis. What did you drop, and by what rule? Did the row count change at the join, and was that right? Are you mapping a count or a rate, and over which denominator? Which class breaks, which projection, which colours? Every one of those changes the conclusion, and none of them is recorded anywhere unless you record it.
The topics run from cleaning and raster work through statistics, terrain, hydrology, movement and public transit to the cartography that decides what the finished thing says.
Topics in Analysis
Each topic page brings that subject's concepts, how-to guides and fixes onto one page.
- Data cleaning Turning a messy download into an analysis-ready dataset you can trust.
- Raster & rasterio Reading, sampling and converting raster data in Python.
- Maps & visualisation Static plots, choropleths, interactive maps, and exporting images people can use.
- Spatial statistics Density, clustering, hotspots and autocorrelation — measuring pattern rather than drawing it.
- Census & demographics Census boundaries and tables: joining them, turning counts into rates, carrying margins of error, and comparing years.
- Housing & property data House prices and short-term rentals in Python: HM Land Registry price paid data, Inside Airbnb listings and calendars, price maps by area, hedonic and repeat-sales indices, and the parsing and joining traps in both.
- Bank branches Every US bank branch from the FDIC's Summary of Deposits in Python: branches per resident, closures since 2015, bank deserts by distance, deposit market share, the largest banks, and the head-office deposits, service types and geocodes that mislead.
- Schools & education Every US public school from NCES's Common Core of Data and EDGE in Python: enrolment, teachers, locale, charter and virtual schools, free-lunch eligibility, neighbourhood poverty, and the -1, -2 and -9 codes that mean no number.
- Terrain & elevation Working with DEMs: slope, aspect, hillshade, contours, profiles and drainage.
- Hydrology & watersheds Where water goes on a DEM: conditioning, flow direction and accumulation, watersheds, stream networks and HAND.
- Movement & time GPS tracks and trajectories: cleaning them, segmenting them, and measuring what moved where.
- Public transit & GTFS Timetables as data: GTFS feeds, service calendars, frequency, transit travel times and the realtime feeds that correct them.
- Web maps & tiles Getting a dataset into a browser: tile pyramids, vector tiles, PMTiles and MapLibre styling.
- Python map libraries Making maps with the popular Python libraries: Plotly choropleths, scatter, density and animated maps, Folium heatmaps, clusters and tooltips, GeoPandas explore, Cartopy projections, pydeck 3D layers and lonboard for millions of points, with the errors each one throws.
- Cartography & map design The decisions that turn a correct plot into a map someone can read: hierarchy, colour, labels and export.
- Election maps & cartograms Mapping votes rather than land: county and constituency results, swing, cartograms, hex and tile maps, dot density and value-by-alpha.
- Animated & time-series maps Maps that change over time: radar and satellite loops, storm tracks, animated choropleths, small multiples, time sliders and the export formats that carry them.
- Wildfire mapping Fire perimeters, satellite fire detections, burn severity, smoke plumes and exposure: mapping wildfires from open CAL FIRE, NOAA GOES, HMS and Sentinel-2 data.
- Land cover & land change Land cover rasters and how they change: NLCD and ESA WorldCover downloads, change matrices, urban growth, impervious surface, class areas and categorical raster pitfalls.
- Health & disease mapping Mapping health: John Snow’s cholera map, CDC PLACES and life expectancy by tract, age-adjusted rates, overdose deaths, scan statistics, hospital access and the ecological fallacy.
- Flow maps & origin–destination data Movement between places: migration, commuting and trip flows, origin–destination matrices, desire lines, curved and bundled flow maps, and the uncertainty in small flows.
- Bike share & micromobility Bike-share trip files and live GBFS feeds: cleaning a year of trips, dockless e-bikes, commuting rhythms, weather, speeds and station coverage.
- Air travel & flight data A year of US domestic flights from the BTS on-time file: airports, routes, delays and their causes, taxi times, aircraft rotations and the jet stream.
- Road traffic counts Britain's road traffic counts in Python: annual average daily flows at 46,754 count points, how they are estimated, trends, hourly profiles, vehicle-kilometres, cycling, lorries and collision rates.
- Street trees Street tree inventories in Python, from New York's 2005 and 2015 censuses: species diversity, trees per kilometre, spacing gaps, health, change between censuses and volunteer data.
- Drought Drought data in Python: US Drought Monitor county statistics, the Standardized Precipitation Index from rain gauges, drought events, flash droughts, streamflow and the people affected.
- Taxi & ride-hail trips NYC taxi and ride-hail trip records in Python: zones, fares, tips, speeds, airport trips, congestion pricing, and the fields that mislead.
- Power plants & electricity US power plants in Python from EIA-860 and EIA-923: where plants are, what they generate, capacity factors, retirements, new solar and batteries, and the data traps.
- Wind turbines The USGS US Wind Turbine Database in Python: every utility-scale turbine on a map, capacity by county, turbine sizes and makers by year, spacing, offshore wind, the EIA-860 match and the traps in the file.
- Solar farms The USGS US Large-Scale Solar Photovoltaic Database in Python: every solar facility of a megawatt or more with its array outline, capacity by county, land per megawatt, trackers and fixed tilt, growth by year, solar on landfills, agrivoltaics, and the AC, DC and area traps.
- Bridges & infrastructure condition The US National Bridge Inventory in Python: mapping 624,193 highway bridges, condition ratings, age, traffic on poor bridges, scour, inspections and the format traps.
- Dams & reservoirs The US National Inventory of Dams in Python: 92,626 dams by county, age, purpose and owner, the largest reservoirs, hazard potential and condition, and the text columns, estimated years and repeated storage in the file.
- 311 & service requests New York's 311 service requests in Python: complaint types, response times, noise, heat and hot water, maps per resident, and the duplicates and impossible dates in the records.
- Severe storms & tornadoes NOAA's Storm Events database in Python: tornado tracks, hail by county, weather deaths, damage estimates, the severe-weather season and the traps in damage strings, zone codes and county segments.
- Hurricanes & tropical cyclones NHC's HURDAT2 best tracks in Python: mapping hurricane seasons, accumulated cyclone energy, US landfalls, rapid intensification, wind radii and the coordinate and record-type traps.
- Disasters & flood insurance OpenFEMA in Python: disaster declarations by county since 1953, declaration types and programs, NFIP flood insurance claims, hurricane claim maps, and the per-county rows, statewide codes and negative payments that trip up a count.
- Electric vehicles Washington State's electric vehicle registrations in Python: adoption by county and census tract, growth since 2017, battery-electric against plug-in hybrids, makes and models, and the zero ranges, ZIP-centroid points and VIN prefixes in the data.
- Restaurant inspections New York's restaurant inspection results in Python: letter grades and scores, violations, closures, pests by neighbourhood, and the placeholder dates, per-violation rows and zero coordinates in the data.
- Food stores & SNAP USDA's list of every store authorised to accept SNAP in Python: retailers per resident, the distance to the nearest supermarket, convenience stores' share, dollar stores, farmers markets and the Restaurant Meals Program, and the chain-name and county-name traps.
- Internet speeds & broadband Ookla's open Speedtest tiles in Python: broadband and mobile speeds by county, the urban-rural gap, change between quarters, latency, and the kilobits, averaging and empty-tile traps.
- Building permits & new housing The Census Bureau's building permits survey in Python: new housing by county since 1990, per resident and by building size, this year's months, and the header rows, imputed counts and Connecticut regions in the files.
- Aircraft registrations The FAA aircraft registry in Python: registered aircraft by county, state and ZIP code, types, ages and models, and the status codes, octal transponder codes and registration addresses in the file.
- Toxic releases EPA's Toxics Release Inventory in Python: facilities and their releases on maps, air releases and carcinogens by county, the change since 2014, and the units, Form A rows and county names in the data.
- Superfund sites EPA's Superfund National Priorities List in Python: every listed, proposed and deleted site with its status, score and milestones, sites by county, people living nearby, cleanup times, federal facilities, site boundaries and areas, and the unit and join traps.
- Mines & quarries MSHA's Mine Data Set in Python: every US mine with its status, commodity and position, active mines by county, coal production and jobs since 2000, injury rates per hour worked, what injures miners, sand, gravel and stone quarries, and the coordinate, id and accident-code traps.
- Historical maps & georeferencing Putting scanned old maps on today's grid: control points, transformations, warping, accuracy, and measuring what has changed since.
- Snow, ice & glaciers Snow cover from satellites, snow depth and water equivalent from stations, sea-ice extent, and glaciers measured from imagery and elevation models.
- Crime & public safety mapping Mapping recorded crime: city open data, hot spots and kernel density, rates per resident, time patterns, near repeats, street segments and what the records leave out.
- Road crashes & traffic safety Mapping road crashes: FARS and STATS19, fatal and injury collisions, rates per resident and per mile driven, pedestrians and cyclists, time of day and light, and the codes that hide missing values.
- Population grids Gridded population: GHSL, WorldPop and census grids, totals per area, density per square kilometre, change since 1975, degree of urbanisation, and the cell-area, resampling and suppression traps that change the count.
- Sea surface temperature & marine heatwaves Sea surface temperature from NOAA OISST and ERSST through ERDDAP: daily maps, anomalies and baselines, marine heatwaves, coral bleaching heat stress, El Niño indices, trends, buoys against satellites, and the longitude, packing and weighting traps.
- Earthquakes & seismic hazard Earthquakes as data from USGS: Gutenberg-Richter b-values and recurrence, ShakeMap stations and Did You Feel It? reports, ground motion against distance, faults, plate boundaries, focal mechanisms, slab depth, hazard curves and maps, and the unit, time and distance traps.
- Volcanoes & eruptions The Smithsonian's Volcanoes of the World database in Python: volcanoes by type and setting, eruptions by explosivity, country and duration, cities near volcanoes, and the date codes and gaps in the eruption record.
- Tsunamis NOAA's Global Historical Tsunami Database in Python: events and run-ups, which tsunamis are certain, causes, the deadliest, travel times across oceans, every tsunami at one place, and the death, damage and country codes that mislead.
- Meteorites & fireballs NASA's Meteorite Landings table and JPL's fireball reports in Python: falls and finds, where meteorites are collected, classes, the largest masses, observed falls by country, fireball energies, and the coordinates that sit at 0,0 or stack on one point.
- Wind & vector fields Wind as data: GFS and HRRR winds from AWS, u and v components, speed and direction, arrows, barbs and streamlines, station observations, wind roses and vorticity.
- Rainfall, radar & storms Weather radar volumes, radar and multi-sensor rainfall grids, rain gauges, storm tracks, and how extreme a rainfall total really was.
- Coastal & marine Depths, tides and shorelines: bathymetry grids, which line is the coast, inundation, vessel tracks and the sea areas a country can claim.
- Ports & harbours The World Port Index in Python: 3,807 ports with their harbour size and type, depths, facilities and restrictions, ports by country, deep-water, container and LNG ports, ports closed by ice, the nearest port to a city, and the zeros and unknowns that hide in the table.
- Agriculture & vegetation Fields, crops and canopies: boundaries, vegetation indices over a season, yield maps, management zones and prescription files.
- Biodiversity & species data Occurrence records as spatial data: what a GBIF record is, the bias in it, richness and diversity per cell, distribution models, ranges and protected areas.
- Linear referencing Locating things along a route rather than on the earth: measures and M values, postmiles and equations, dynamic segmentation, and moving events between networks.
- Natural hazards & risk Floods, fires, earthquakes and landslides as data: return periods, severity and shaking, who is exposed, and the arithmetic that turns the three into a risk figure.
- Air quality Pollution as data: station networks and their units, indices, satellite NO2, models, interpolation, land-use regression and population exposure.
- Renewable energy siting Sun, wind and land as data: irradiance and wind resource, yield models, exclusion masks, terrain shading, grid distance and suitability maps.
- Urban form & morphology Cities measured from their footprints and streets: coverage and floor area ratio, tessellation cells, blocks, street orientation and network metrics, and where the city ends.
- Forest monitoring Forest cover and loss as data: Global Forest Change, forest definitions and thresholds, rates, fragmentation, protected areas, hotspots, canopy height and new clearing.
- Urban heat Heat in cities as data: land surface temperature from Landsat and MODIS, heat islands by day and night, green space, air temperature, heatwaves and who is exposed.