Skip to content

Commit

Permalink
Update data based on new data
Browse files Browse the repository at this point in the history
  • Loading branch information
ajparsons committed Feb 2, 2024
1 parent e062d44 commit acd5b83
Show file tree
Hide file tree
Showing 11 changed files with 275 additions and 130 deletions.
9 changes: 5 additions & 4 deletions data/interim/ruc_cluster.csv
Expand Up @@ -59,7 +59,7 @@ CBF,Central Bedfordshire Council,Urban with rural areas
CCG,Causeway Coast and Glens Borough Council,Sparse and rural
CGN,Ceredigion County Council,Sparse and rural
CHA,Charnwood Borough Council,Urban
CHE,Cheshire East Council,Urban with rural areas
CHE,Cheshire East Council,Urban
CHI,Chichester District Council,Rural
CHL,Chelmsford City Council,Urban with rural areas
CHO,Chorley Borough Council,Urban with rural areas
Expand All @@ -70,7 +70,7 @@ CHW,Cheshire West and Chester Council,Urban with rural areas
CLD,Calderdale Metropolitan Borough Council,Urban
CLK,Clackmannanshire Council,Rural
CMD,London Borough of Camden,Urban
CMN,Carmarthenshire County Council,Rural
CMN,Carmarthenshire County Council,Urban with rural areas
COL,Colchester Borough Council,Urban with rural areas
CON,Cornwall Council,Rural
COT,Cotswold District Council,Rural
Expand All @@ -82,7 +82,7 @@ CWY,Conwy County Borough Council,Urban with rural areas
DAC,Dacorum Borough Council,Urban
DAL,Darlington Borough Council,Urban
DAR,Dartford Borough Council,Urban
DEB,Derbyshire Dales District Council,Sparse and rural
DEB,Derbyshire Dales District Council,Rural
DEN,Denbighshire County Council,Rural
DER,Derby City Council,Urban
DGY,Dumfries and Galloway Council,Sparse and rural
Expand Down Expand Up @@ -212,7 +212,7 @@ NGM,Nottingham City Council,Urban
NHE,North Hertfordshire District Council,Urban
NKE,North Kesteven District Council,Rural
NLK,North Lanarkshire Council,Urban
NLN,North Lincolnshire Council,Rural
NLN,North Lincolnshire Council,Urban with rural areas
NMD,"Newry, Mourne and Down District Council",Sparse and rural
NNO,North Norfolk District Council,Sparse and rural
NNT,North Northamptonshire Council,Urban with rural areas
Expand Down Expand Up @@ -392,3 +392,4 @@ TVCA,Tees Valley Combined Authority,Urban
WECA,West of England Combined Authority,Urban
WMCA,West Midlands Combined Authority,Urban
WYCA,West Yorkshire Combined Authority,Urban
YNYC,York and North Yorkshire Mayoral Combined Authority,Urban with rural areas
2 changes: 1 addition & 1 deletion data/packages/uk_ruc/composite_ruc.resource.yaml
Expand Up @@ -45,9 +45,9 @@ schema:
unique: false
enum:
- E
- N
- S
- W
- N
example: E
- name: pop
type: integer
Expand Down
9 changes: 5 additions & 4 deletions data/packages/uk_ruc/la_ruc.csv
Expand Up @@ -59,7 +59,7 @@ CBF,Central Bedfordshire Council,0.10308403314764003,0.2796243175078296,0.617291
CCG,Causeway Coast and Glens Borough Council,0.4961167528459887,0.18391748876447156,0.3199657583895397,Sparse and rural
CGN,Ceredigion County Council,0.6044707338881629,0.16552720269619645,0.2300020634156407,Sparse and rural
CHA,Charnwood Borough Council,0.06002119977831704,0.07800872742142899,0.861970072800254,Urban
CHE,Cheshire East Council,0.14504675232720382,0.046570107665715656,0.8083831400070806,Urban with rural areas
CHE,Cheshire East Council,0.14504675232720382,0.046570107665715656,0.8083831400070806,Urban
CHI,Chichester District Council,0.2666578606279256,0.2600780985560848,0.47326404081598955,Rural
CHL,Chelmsford City Council,0.08502814090633899,0.09872861403233402,0.816243245061327,Urban with rural areas
CHO,Chorley Borough Council,0.11512823983217162,0.17116126412668337,0.713710496041145,Urban with rural areas
Expand All @@ -70,7 +70,7 @@ CHW,Cheshire West and Chester Council,0.10698077074424828,0.1478498619819221,0.7
CLD,Calderdale Metropolitan Borough Council,0.05923246080726396,0.10484500248279775,0.8359225367099383,Urban
CLK,Clackmannanshire Council,0.12574699262708575,0.47605743112145904,0.3981955762514552,Rural
CMD,London Borough of Camden,0.0,0.0,1.0,Urban
CMN,Carmarthenshire County Council,0.31262746926169804,0.1868666267594069,0.500505903978895,Rural
CMN,Carmarthenshire County Council,0.31262746926169804,0.1868666267594069,0.500505903978895,Urban with rural areas
COL,Colchester Borough Council,0.0784413423315152,0.19634731338530914,0.7252113442831757,Urban with rural areas
CON,Cornwall Council,0.3179564519697039,0.28292700911903196,0.39911653891126414,Rural
COT,Cotswold District Council,0.36505975829605397,0.40571097905677594,0.2292292626471701,Rural
Expand All @@ -82,7 +82,7 @@ CWY,Conwy County Borough Council,0.12287228142624336,0.18239294216018362,0.69473
DAC,Dacorum Borough Council,0.058838352836272236,0.05986573018098641,0.8812959169827413,Urban
DAL,Darlington Borough Council,0.05675870527981424,0.08106513861970169,0.862176156100484,Urban
DAR,Dartford Borough Council,0.015327780047244374,0.07607054686251177,0.9086016730902439,Urban
DEB,Derbyshire Dales District Council,0.4349948150708607,0.3456619426201175,0.21934324230902177,Sparse and rural
DEB,Derbyshire Dales District Council,0.4349948150708607,0.3456619426201175,0.21934324230902177,Rural
DEN,Denbighshire County Council,0.2186298277879953,0.2905241598394917,0.49084601237251296,Rural
DER,Derby City Council,0.0,0.0,1.0,Urban
DGY,Dumfries and Galloway Council,0.4438062609162972,0.25009404809888486,0.30609969098481793,Sparse and rural
Expand Down Expand Up @@ -212,7 +212,7 @@ NGM,Nottingham City Council,0.0,0.0,1.0,Urban
NHE,North Hertfordshire District Council,0.10351126750018717,0.06801677023283671,0.8284719622669762,Urban
NKE,North Kesteven District Council,0.2160971646067656,0.3929521447205235,0.39095069067271093,Rural
NLK,North Lanarkshire Council,0.09092773237249904,0.0815068693792659,0.827565398248235,Urban
NLN,North Lincolnshire Council,0.1533907552294941,0.28127249088756295,0.5653367538829429,Rural
NLN,North Lincolnshire Council,0.1533907552294941,0.28127249088756295,0.5653367538829429,Urban with rural areas
NMD,"Newry, Mourne and Down District Council",0.5532469388989383,0.24027512796969414,0.20647793313136756,Sparse and rural
NNO,North Norfolk District Council,0.500338620906741,0.37660367999847383,0.12305769909478524,Sparse and rural
NNT,North Northamptonshire Council,0.07663657144169912,0.22297747452818267,0.7003859540301182,Urban with rural areas
Expand Down Expand Up @@ -392,3 +392,4 @@ TVCA,Tees Valley Combined Authority,0.02851567585480454,0.07117749399358526,0.90
WECA,West of England Combined Authority,0.048875924871940805,0.03306496827190173,0.9180591068561574,Urban
WMCA,West Midlands Combined Authority,0.0011698454410856822,0.006761269579374662,0.9920688849795397,Urban
WYCA,West Yorkshire Combined Authority,0.017857472060721923,0.07023115848485018,0.9119113694544279,Urban
YNYC,York and North Yorkshire Mayoral Combined Authority,0.2406802691535372,0.2040071343064566,0.5553125965400062,Urban with rural areas
6 changes: 3 additions & 3 deletions data/packages/uk_ruc/la_ruc.resource.yaml
@@ -1,7 +1,7 @@
title: Local Authority RUC Profile
description: Based on LSOA information, a RUC label and profile for each local authority.
custom:
row_count: 393
row_count: 394
path: la_ruc.csv
name: la_ruc
profile: tabular-data-resource
Expand Down Expand Up @@ -51,9 +51,9 @@ schema:
constraints:
unique: false
enum:
- Rural
- Sparse and rural
- Urban
- Rural
- Urban with rural areas
example: Rural
hash: 8130f4fc8a86e583f6393ade36006d61
hash: d8ac3044cfd0555323903f1efc877c65
4 changes: 2 additions & 2 deletions data/packages/uk_ruc/pcon_2025_ruc.resource.yaml
Expand Up @@ -49,9 +49,9 @@ schema:
constraints:
unique: false
enum:
- Urban with rural areas
- Rural
- Urban
- Sparse and rural
- Urban
- Urban with rural areas
example: Rural
hash: c5f0c390b49144a82f8f38e60fca299e
4 changes: 2 additions & 2 deletions data/packages/uk_ruc/pcon_ruc.resource.yaml
Expand Up @@ -49,9 +49,9 @@ schema:
constraints:
unique: false
enum:
- Urban
- Urban with rural areas
- Rural
- Sparse and rural
- Urban
- Urban with rural areas
example: Rural
hash: 40e59e43c6ac36dc46568ba24782f649
2 changes: 1 addition & 1 deletion docs/theme
269 changes: 206 additions & 63 deletions notebooks/ruc_clustering.ipynb

Large diffs are not rendered by default.

96 changes: 48 additions & 48 deletions notebooks/ruc_clustering_cons.ipynb
Expand Up @@ -5,10 +5,10 @@
"execution_count": 1,
"metadata": {
"execution": {
"iopub.execute_input": "2023-08-10T14:25:37.260089Z",
"iopub.status.busy": "2023-08-10T14:25:37.259740Z",
"iopub.status.idle": "2023-08-10T14:25:38.972968Z",
"shell.execute_reply": "2023-08-10T14:25:38.972261Z"
"iopub.execute_input": "2024-02-02T13:55:24.059629Z",
"iopub.status.busy": "2024-02-02T13:55:24.059392Z",
"iopub.status.idle": "2024-02-02T13:55:25.541334Z",
"shell.execute_reply": "2024-02-02T13:55:25.540626Z"
}
},
"outputs": [],
Expand All @@ -24,10 +24,10 @@
"execution_count": 2,
"metadata": {
"execution": {
"iopub.execute_input": "2023-08-10T14:25:38.976939Z",
"iopub.status.busy": "2023-08-10T14:25:38.976526Z",
"iopub.status.idle": "2023-08-10T14:25:39.147226Z",
"shell.execute_reply": "2023-08-10T14:25:39.146555Z"
"iopub.execute_input": "2024-02-02T13:55:25.544829Z",
"iopub.status.busy": "2024-02-02T13:55:25.544324Z",
"iopub.status.idle": "2024-02-02T13:55:25.660557Z",
"shell.execute_reply": "2024-02-02T13:55:25.659807Z"
}
},
"outputs": [
Expand Down Expand Up @@ -123,10 +123,10 @@
"execution_count": 3,
"metadata": {
"execution": {
"iopub.execute_input": "2023-08-10T14:25:39.150304Z",
"iopub.status.busy": "2023-08-10T14:25:39.150053Z",
"iopub.status.idle": "2023-08-10T14:25:39.991614Z",
"shell.execute_reply": "2023-08-10T14:25:39.990848Z"
"iopub.execute_input": "2024-02-02T13:55:25.663350Z",
"iopub.status.busy": "2024-02-02T13:55:25.662885Z",
"iopub.status.idle": "2024-02-02T13:55:26.458658Z",
"shell.execute_reply": "2024-02-02T13:55:26.457944Z"
}
},
"outputs": [
Expand Down Expand Up @@ -160,10 +160,10 @@
"execution_count": 4,
"metadata": {
"execution": {
"iopub.execute_input": "2023-08-10T14:25:39.994952Z",
"iopub.status.busy": "2023-08-10T14:25:39.994575Z",
"iopub.status.idle": "2023-08-10T14:25:40.016017Z",
"shell.execute_reply": "2023-08-10T14:25:40.015425Z"
"iopub.execute_input": "2024-02-02T13:55:26.461610Z",
"iopub.status.busy": "2024-02-02T13:55:26.461390Z",
"iopub.status.idle": "2024-02-02T13:55:26.477967Z",
"shell.execute_reply": "2024-02-02T13:55:26.477302Z"
}
},
"outputs": [
Expand Down Expand Up @@ -204,25 +204,25 @@
" <th>1</th>\n",
" <td>369</td>\n",
" <td>56.8</td>\n",
" <td>[E14000736, E14000873, E14000974, E14001040, E...</td>\n",
" <td>[W07000051, E14000731, E14000530, E14001055, E...</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>63</td>\n",
" <td>9.7</td>\n",
" <td>[E14000816, E14000993, E14000746, W07000065, E...</td>\n",
" <td>[S14000050, E14000707, W07000064, N06000006, E...</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>154</td>\n",
" <td>23.7</td>\n",
" <td>[E14000842, E14000948, S14000039, E14000619, E...</td>\n",
" <td>[E14000987, E14000590, E14000936, E14000927, E...</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>64</td>\n",
" <td>9.8</td>\n",
" <td>[S14000006, E14000767, E14000981, E14000740, E...</td>\n",
" <td>[E14000961, E14000929, E14001045, W07000057, E...</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
Expand All @@ -231,10 +231,10 @@
"text/plain": [
" count % random members\n",
"labels \n",
"1 369 56.8 [E14000736, E14000873, E14000974, E14001040, E...\n",
"2 63 9.7 [E14000816, E14000993, E14000746, W07000065, E...\n",
"3 154 23.7 [E14000842, E14000948, S14000039, E14000619, E...\n",
"4 64 9.8 [S14000006, E14000767, E14000981, E14000740, E..."
"1 369 56.8 [W07000051, E14000731, E14000530, E14001055, E...\n",
"2 63 9.7 [S14000050, E14000707, W07000064, N06000006, E...\n",
"3 154 23.7 [E14000987, E14000590, E14000936, E14000927, E...\n",
"4 64 9.8 [E14000961, E14000929, E14001045, W07000057, E..."
]
},
"execution_count": 4,
Expand All @@ -251,10 +251,10 @@
"execution_count": 5,
"metadata": {
"execution": {
"iopub.execute_input": "2023-08-10T14:25:40.019051Z",
"iopub.status.busy": "2023-08-10T14:25:40.018687Z",
"iopub.status.idle": "2023-08-10T14:25:40.885830Z",
"shell.execute_reply": "2023-08-10T14:25:40.885207Z"
"iopub.execute_input": "2024-02-02T13:55:26.480459Z",
"iopub.status.busy": "2024-02-02T13:55:26.480108Z",
"iopub.status.idle": "2024-02-02T13:55:27.326877Z",
"shell.execute_reply": "2024-02-02T13:55:27.326210Z"
}
},
"outputs": [
Expand Down Expand Up @@ -285,10 +285,10 @@
"execution_count": 6,
"metadata": {
"execution": {
"iopub.execute_input": "2023-08-10T14:25:40.890337Z",
"iopub.status.busy": "2023-08-10T14:25:40.889992Z",
"iopub.status.idle": "2023-08-10T14:25:41.717757Z",
"shell.execute_reply": "2023-08-10T14:25:41.717024Z"
"iopub.execute_input": "2024-02-02T13:55:27.329792Z",
"iopub.status.busy": "2024-02-02T13:55:27.329478Z",
"iopub.status.idle": "2024-02-02T13:55:28.045115Z",
"shell.execute_reply": "2024-02-02T13:55:28.044372Z"
}
},
"outputs": [
Expand Down Expand Up @@ -339,25 +339,25 @@
" <th>1: Urban</th>\n",
" <td>369</td>\n",
" <td>56.8</td>\n",
" <td>[E14000593, E14000673, E14000809, E14000702, E...</td>\n",
" <td>[E14000555, E14000790, E14000866, E14000693, E...</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2: Sparse and rural</th>\n",
" <td>63</td>\n",
" <td>9.7</td>\n",
" <td>[E14000608, E14000624, W07000067, E14000941, N...</td>\n",
" <td>[S14000027, E14000860, E14001031, E14000917, E...</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3: Rural</th>\n",
" <td>64</td>\n",
" <td>9.8</td>\n",
" <td>[E14000856, E14000929, S14000020, E14000734, W...</td>\n",
" <td>[E14000813, E14000934, E14001034, E14001046, E...</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4: Urban with rural areas</th>\n",
" <td>154</td>\n",
" <td>23.7</td>\n",
" <td>[E14001023, E14000546, E14000574, S14000038, W...</td>\n",
" <td>[E14000827, E14000824, E14000945, E14000918, E...</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
Expand All @@ -373,10 +373,10 @@
"\n",
" random members \n",
"labels \n",
"1: Urban [E14000593, E14000673, E14000809, E14000702, E... \n",
"2: Sparse and rural [E14000608, E14000624, W07000067, E14000941, N... \n",
"3: Rural [E14000856, E14000929, S14000020, E14000734, W... \n",
"4: Urban with rural areas [E14001023, E14000546, E14000574, S14000038, W... "
"1: Urban [E14000555, E14000790, E14000866, E14000693, E... \n",
"2: Sparse and rural [S14000027, E14000860, E14001031, E14000917, E... \n",
"3: Rural [E14000813, E14000934, E14001034, E14001046, E... \n",
"4: Urban with rural areas [E14000827, E14000824, E14000945, E14000918, E... "
]
},
"execution_count": 6,
Expand Down Expand Up @@ -409,10 +409,10 @@
"execution_count": 7,
"metadata": {
"execution": {
"iopub.execute_input": "2023-08-10T14:25:41.721015Z",
"iopub.status.busy": "2023-08-10T14:25:41.720638Z",
"iopub.status.idle": "2023-08-10T14:25:41.737108Z",
"shell.execute_reply": "2023-08-10T14:25:41.736406Z"
"iopub.execute_input": "2024-02-02T13:55:28.047965Z",
"iopub.status.busy": "2024-02-02T13:55:28.047557Z",
"iopub.status.idle": "2024-02-02T13:55:28.061888Z",
"shell.execute_reply": "2024-02-02T13:55:28.061220Z"
}
},
"outputs": [
Expand Down Expand Up @@ -519,10 +519,10 @@
"execution_count": 8,
"metadata": {
"execution": {
"iopub.execute_input": "2023-08-10T14:25:41.740365Z",
"iopub.status.busy": "2023-08-10T14:25:41.739912Z",
"iopub.status.idle": "2023-08-10T14:25:41.749800Z",
"shell.execute_reply": "2023-08-10T14:25:41.749198Z"
"iopub.execute_input": "2024-02-02T13:55:28.064176Z",
"iopub.status.busy": "2024-02-02T13:55:28.063986Z",
"iopub.status.idle": "2024-02-02T13:55:28.073319Z",
"shell.execute_reply": "2024-02-02T13:55:28.072696Z"
}
},
"outputs": [],
Expand Down
2 changes: 1 addition & 1 deletion src/uk_ruc/create_la_data.py
Expand Up @@ -6,7 +6,7 @@
from datetime import date

# get the current pictuer of councils on this date
council_date = date(2023, 4, 2)
council_date = date(2024, 2, 2)


def get_lsoa_data() -> pd.DataFrame:
Expand Down

0 comments on commit acd5b83

Please sign in to comment.