From dff7ea6fad63e8538b24060da22c2d46880512f8 Mon Sep 17 00:00:00 2001 From: Diego Ripley Date: Thu, 18 Sep 2025 18:52:45 +0000 Subject: [PATCH] Fix mistake in creating pop_ctr Census of Population file. Select distinct pop_ctr_dguid before joining to Census of Pop attribute data --- census_of_population/process_2021.ipynb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/census_of_population/process_2021.ipynb b/census_of_population/process_2021.ipynb index b4489d6..28f77ee 100644 --- a/census_of_population/process_2021.ipynb +++ b/census_of_population/process_2021.ipynb @@ -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",