Fix mistake in creating pop_ctr Census of Population file. Select distinct pop_ctr_dguid before joining to Census of Pop attribute data

This commit is contained in:
Diego Ripley
2025-09-18 18:52:45 +00:00
parent 1a7ea7e40a
commit dff7ea6fad
+2 -2
View File
@@ -118866,7 +118866,7 @@
"source": [
"## 4.0 Process Population centres (POPCTRs)\n",
"### There are 1026 DGUIDs in the Census of Population data, but there should be 1030\n",
"They also use the pop_ctr_dguid and not the pop_ctr_p_dguid. So, there's no way to differentiate between Ottawa, and Gatineau for pop_ctr_dguid 2021S05100616"
"- They also use the pop_ctr_dguid and not the pop_ctr_p_dguid. So, there's no way to differentiate between Ottawa, and Gatineau for pop_ctr_dguid 2021S05100616"
]
},
{
@@ -118909,7 +118909,7 @@
"DROP TABLE IF EXISTS er_2021;\n",
"\n",
"DROP TABLE IF EXISTS pop_ctr_2021;\n",
"CREATE TABLE pop_ctr_2021 AS SELECT pop_ctr_dguid AS dguid FROM 'https://data-01.dataforcanada.org/processed/statistics_canada/boundaries/2021/digital_boundary_files/pop_ctr_2021.parquet';\n",
"CREATE TABLE pop_ctr_2021 AS SELECT DISTINCT pop_ctr_dguid AS dguid FROM 'https://data-01.dataforcanada.org/processed/statistics_canada/boundaries/2021/digital_boundary_files/pop_ctr_2021.parquet';\n",
"\"\"\")\n",
"con.commit()\n",
"\n",