This repo contains the data behind the https://antiraids.github.io/ FOI investigation.
- ☑
LondonRaids.py
: munge the FOI data into a useable format - ☑
MakeItInteractive.py
: making the interactive choropleth - ☑
ByEthnicity.py
: munging the ethnicity data - ☑
Trends.py
: visualise, calculate trends - ☑
TellingTheStory.ipynb
: making static plots for the site, along with the narrative of the analysis - ☑
interactive_line.ipynb
: making interactive line plots of raids per area per year, for the site - ☑
EthnicityRegression.ipynb
: investigating the ethnicity correlations using Bayesian regression. Original investigation was done in theethnicity_regression.py
file, changed to .ipynb for ease of following the flow.
Data file | Source | Used in |
---|---|---|
AmendedData\\LondonRaidsByYear.csv |
LondonRaids.py |
TellingTheStory.ipynb |
AmendedData\\TotalLondonRaidsByYear.csv |
LondonRaids.py |
TellingTheStory.ipynb , Trends.py |
AmendedData\\PopnRaidsRate.csv |
MakeItInteractive.py |
TellingTheStory.ipynb |
AmendedData\\PostcodeEthnicityRates_toplevel.csv |
ByEthnicity.py |
TellingTheStory.ipynb |
AmendedData\\PostcodeEthnicityRates_keylines.csv |
ByEthnicity.py |
TellingTheStory.ipynb |
AmendedData\\RaidTrends.csv |
Trends.py |
TellingTheStory.ipynb |
AmendedData\\TotalLondonPostcodesWithData.shp |
LondonRaids.py |
MakeItInteractive.py |
AmendedData\\LondonPop.csv |
LondonRaids.py |
MakeItInteractive.py |
RawData\\missingpop.csv |
"Street Check" e.g. for EC4R | MakeItInteractive.py |
RawData\\KS201EW_Postcode district_Ethnic group.csv |
Nomis | ByEthnicity.py |
RawData\55886 xxx Appendix A.xlsx |
Home Office FOI | LondonRaids.py |
RawData\57252 xxx Appendix A.xlsx |
Home Office FOI | LondonRaids.py |
RawData\56323 xxx Annex.xlsx |
Home Office FOI | LondonRaids.py |
RawData\56325 xxx Annex.xlsx |
Home Office FOI | LondonRaids.py |
RawData\\57894 PDF scrape_2019RaidsENW.txt (for 2019) |
Home Office FOI | LondonRaids.py |
RawData\\64002 xxx Annex.xlsx (for 2020) |
Home Office FOI | LondonRaids.py |
RawData\\68195 xxx Annex B.xlsx (for 2021) |
Home Office FOI | LondonRaids.py |
RawData\\FOI 2022 immigration raids - FOI 76110.csv (for 2022) |
Home Office FOI | LondonRaids.py |
PostalDistrict.shp * |
From University of Edinburgh, via StackExchange | LondonRaids.py |
RawData\PostDistNames.csv |
Wikipedia | LondonRaids.py , to assign names to postcode areas |
RawData\ECPostDistNames.csv |
Wikipedia | LondonRaids.py , to assign names to postcode areas |
RawData\Nomis KS101EW usual resident population London.csv |
Nomis | LondonRaids.py |
RawData\returns-datasets-dec-2022.xlsx |
Gov.uk | deportation_data_investigation.py |
* not included in this repo for size reasons (as it is 85 MB)
Timespan: the FOI data runs from 2014 to 2022 inclusive.
Tools used:
- Straight-up Python for the data munging and basic analysis
- Folium and Geopandas packages to visualise the data in a choropleth map, weighed by number of immigration raids since 2014, and also optionally by immigration raids per 1,000 residents.
- mpld3 for the interactive charts
Hat tips to:
- this AutoGIS walk-through
- Folium's clear documentation
- this Towards Data Science walk-through
- Bambi and walkthroughs for the Bayesian regression,
- Box-Cox transformations, in general
Notes:
- By "London", we mean the "London postal district" i.e. any postcode with postcode area N, NW, SW, SE, W, WC, E or EC.
- For a lot of the preparation time, the assumption was that "postcode district" was the correct term for what is actually technically the "outward code" -- so there are a lot of references to "district" and "postdist" in the code.