Skip to content

Commit

Permalink
add cities with population > 1 mil
Browse files Browse the repository at this point in the history
  • Loading branch information
hoishing committed Dec 13, 2024
1 parent e881c89 commit 1d2a61b
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
Binary file modified natal/data/cities.csv.gz
Binary file not shown.
19 changes: 16 additions & 3 deletions preprocess_cities.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@
"criteria = (\n",
" ((df[\"feature code\"] == \"PPLA\") & (df[\"population\"] > 10000))\n",
" | ((df[\"feature code\"].isin([\"PPLA2\", \"PPLA3\"])) & (df[\"population\"] > 500_000))\n",
" | ((df[\"feature code\"] == \"PPL\") & (df[\"population\"] > 1_000_000))\n",
" | (df[\"feature code\"].isin([\"PPLC\", \"PPLCD\", \"PPLCH\"]))\n",
")"
]
Expand Down Expand Up @@ -169,14 +170,26 @@
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [],
"outputs": [
{
"data": {
"text/plain": [
"3222"
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"cities = df.sort_values(\n",
" by=[\"name\", \"pop\"],\n",
" key=lambda x: x.str.lower() if x.name == \"name\" else x,\n",
" ascending=[True, False],\n",
")\n",
"cities = cities.drop_duplicates(subset=[\"name\", \"country\"], keep=\"first\")"
"cities = cities.drop_duplicates(subset=[\"name\", \"country\"], keep=\"first\")\n",
"len(cities)"
]
},
{
Expand All @@ -198,7 +211,7 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": 9,
"metadata": {},
"outputs": [],
"source": [
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "natal"
version = "0.8.11"
version = "0.8.12"
description = "create Natal Chart with ease"
license = "MIT"
repository = "https://github.com/hoishing/natal"
Expand Down

0 comments on commit 1d2a61b

Please sign in to comment.