Skip to content

Commit

Permalink
Fix: adjust pipeline that generates areas.json to use updated geog names
Browse files Browse the repository at this point in the history
  • Loading branch information
luke-strange committed Aug 6, 2024
1 parent f337a3a commit 2d9e938
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 43 deletions.
60 changes: 30 additions & 30 deletions pipelines/vacant-homes/areas.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@
"latest_year = data.Year.max()\n",
"\n",
"dwellings_slice = data.loc[(data['Measure']=='Dwellings') & (data['Value'].notna())]\n",
"dwellings_group = dwellings_slice.groupby(['AreaCode'])\n",
"dwellings_group = dwellings_slice.groupby(['geography_code'])\n",
"dwellings_latest_years = dwellings_group.Year.max()\n",
"dwellings_names = dwellings_group.AreaName.last().str.strip()"
"dwellings_names = dwellings_group.geography_name.last().str.strip()"
]
},
{
Expand All @@ -52,7 +52,7 @@
"outputs": [],
"source": [
"vacants_slice = data.loc[(data['Measure']=='AllVacants') & (data['Value'].notna())]\n",
"vacants_group = vacants_slice.groupby(['AreaCode'])\n",
"vacants_group = vacants_slice.groupby(['geography_code'])\n",
"vacants_latest_years = vacants_group.Year.max()\n",
"codes_not_in_dwellings = []\n",
"for code in vacants_latest_years.index.unique():\n",
Expand Down Expand Up @@ -102,7 +102,7 @@
" <th>name</th>\n",
" </tr>\n",
" <tr>\n",
" <th>AreaCode</th>\n",
" <th>geography_code</th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
Expand Down Expand Up @@ -193,33 +193,33 @@
"</div>"
],
"text/plain": [
" dwellingsLastPublished vacantsLastPublished active \\\n",
"AreaCode \n",
"E06000001 2023 2023.0 True \n",
"E06000002 2023 2023.0 True \n",
"E06000003 2023 2023.0 True \n",
"E06000004 2023 2023.0 True \n",
"E06000005 2023 2023.0 True \n",
"... ... ... ... \n",
"E12000006 2023 2023.0 True \n",
"E12000007 2023 2023.0 True \n",
"E12000008 2023 2023.0 True \n",
"E12000009 2023 2023.0 True \n",
"E92000001 2023 2023.0 True \n",
" dwellingsLastPublished vacantsLastPublished active \\\n",
"geography_code \n",
"E06000001 2023 2023.0 True \n",
"E06000002 2023 2023.0 True \n",
"E06000003 2023 2023.0 True \n",
"E06000004 2023 2023.0 True \n",
"E06000005 2023 2023.0 True \n",
"... ... ... ... \n",
"E12000006 2023 2023.0 True \n",
"E12000007 2023 2023.0 True \n",
"E12000008 2023 2023.0 True \n",
"E12000009 2023 2023.0 True \n",
"E92000001 2023 2023.0 True \n",
"\n",
" name \n",
"AreaCode \n",
"E06000001 Hartlepool \n",
"E06000002 Middlesbrough \n",
"E06000003 Redcar and Cleveland \n",
"E06000004 Stockton-on-Tees \n",
"E06000005 Darlington \n",
"... ... \n",
"E12000006 East of England \n",
"E12000007 London \n",
"E12000008 South East \n",
"E12000009 South West \n",
"E92000001 England \n",
" name \n",
"geography_code \n",
"E06000001 Hartlepool \n",
"E06000002 Middlesbrough \n",
"E06000003 Redcar and Cleveland \n",
"E06000004 Stockton-on-Tees \n",
"E06000005 Darlington \n",
"... ... \n",
"E12000006 East of England \n",
"E12000007 London \n",
"E12000008 South East \n",
"E12000009 South West \n",
"E92000001 England \n",
"\n",
"[381 rows x 4 columns]"
]
Expand Down
26 changes: 13 additions & 13 deletions src/data/areas/place-page/_data/areas.json
Original file line number Diff line number Diff line change
Expand Up @@ -1005,7 +1005,7 @@
"dwellingsLastPublished":2023,
"vacantsLastPublished":2023,
"active":true,
"name":"Folkestone and Hythe [note 7]"
"name":"Folkestone and Hythe"
},
"E07000113":{
"dwellingsLastPublished":2023,
Expand Down Expand Up @@ -1557,7 +1557,7 @@
"dwellingsLastPublished":2019,
"vacantsLastPublished":2018,
"active":false,
"name":"St. Edmundsbury"
"name":"St Edmundsbury"
},
"E07000205":{
"dwellingsLastPublished":2019,
Expand Down Expand Up @@ -1773,7 +1773,7 @@
"dwellingsLastPublished":2023,
"vacantsLastPublished":2023,
"active":true,
"name":"St. Albans"
"name":"St Albans"
},
"E07000241":{
"dwellingsLastPublished":2023,
Expand Down Expand Up @@ -1887,7 +1887,7 @@
"dwellingsLastPublished":2023,
"vacantsLastPublished":2023,
"active":true,
"name":"St Helens"
"name":"St. Helens"
},
"E08000014":{
"dwellingsLastPublished":2023,
Expand Down Expand Up @@ -2433,37 +2433,37 @@
"dwellingsLastPublished":2023,
"vacantsLastPublished":null,
"active":true,
"name":"Greater Manchester (Met County)"
"name":"Greater Manchester"
},
"E11000002":{
"dwellingsLastPublished":2023,
"vacantsLastPublished":null,
"active":true,
"name":"Merseyside (Met County)"
"name":"Merseyside"
},
"E11000003":{
"dwellingsLastPublished":2023,
"vacantsLastPublished":null,
"active":true,
"name":"South Yorkshire (Met County)"
"name":"South Yorkshire"
},
"E11000004":{
"E11000005":{
"dwellingsLastPublished":2023,
"vacantsLastPublished":null,
"active":true,
"name":"Tyne and Wear (Met County)"
"name":"West Midlands"
},
"E11000005":{
"E11000006":{
"dwellingsLastPublished":2023,
"vacantsLastPublished":null,
"active":true,
"name":"West Midlands (Met County)"
"name":"West Yorkshire"
},
"E11000006":{
"E11000007":{
"dwellingsLastPublished":2023,
"vacantsLastPublished":null,
"active":true,
"name":"West Yorkshire (Met County)"
"name":"Tyne and Wear"
},
"E12000001":{
"dwellingsLastPublished":2023,
Expand Down

0 comments on commit 2d9e938

Please sign in to comment.