Skip to content

Commit 0bbc8d1

Browse files
committed
⬆️ Update to Python 3.13, NumPy 2.1 and pandas 2.2
* Replace dataframe.applymap with dataframe.apply * Replace pandas.value_counts with pandas.Series(obj).value_counts() * Replace as_index=False for groupby() with reset_index(drop=True) * Add include_groups=False for DataFrameGroupBy.apply
1 parent 7ec08eb commit 0bbc8d1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+6276
-6545
lines changed

docs/clean-prep/bulwark.ipynb

+7-7
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@
9797
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
9898
"\u001b[0;31mAssertionError\u001b[0m Traceback (most recent call last)",
9999
"Cell \u001b[0;32mIn[1], line 21\u001b[0m\n\u001b[1;32m 18\u001b[0m df \u001b[38;5;241m=\u001b[39m pd\u001b[38;5;241m.\u001b[39mDataFrame({\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124ma\u001b[39m\u001b[38;5;124m\"\u001b[39m: [\u001b[38;5;241m1\u001b[39m, \u001b[38;5;241m2\u001b[39m, \u001b[38;5;241m3\u001b[39m], \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mb\u001b[39m\u001b[38;5;124m\"\u001b[39m: [\u001b[38;5;241m4\u001b[39m, \u001b[38;5;241m5\u001b[39m, \u001b[38;5;241m6\u001b[39m]})\n\u001b[1;32m 19\u001b[0m df2 \u001b[38;5;241m=\u001b[39m pd\u001b[38;5;241m.\u001b[39mDataFrame({\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124ma\u001b[39m\u001b[38;5;124m\"\u001b[39m: [\u001b[38;5;241m1\u001b[39m, np\u001b[38;5;241m.\u001b[39mnan, \u001b[38;5;241m3\u001b[39m, \u001b[38;5;241m4\u001b[39m], \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mb\u001b[39m\u001b[38;5;124m\"\u001b[39m: [\u001b[38;5;241m4\u001b[39m, \u001b[38;5;241m5\u001b[39m, \u001b[38;5;241m6\u001b[39m, \u001b[38;5;241m7\u001b[39m]})\n\u001b[0;32m---> 21\u001b[0m \u001b[43mappend_a_df\u001b[49m\u001b[43m(\u001b[49m\u001b[43mdf\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mdf2\u001b[49m\u001b[43m)\u001b[49m\n",
100-
"File \u001b[0;32m~/.local/share/virtualenvs/python-311-6zxVKbDJ/lib/python3.11/site-packages/bulwark/decorators.py:81\u001b[0m, in \u001b[0;36mCustomCheck.__call__.<locals>.decorated\u001b[0;34m(*args, **kwargs)\u001b[0m\n\u001b[1;32m 78\u001b[0m df \u001b[38;5;241m=\u001b[39m f(\u001b[38;5;241m*\u001b[39margs, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs)\n\u001b[1;32m 79\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39menabled:\n\u001b[1;32m 80\u001b[0m \u001b[38;5;66;03m# differs from BaseDecorator\u001b[39;00m\n\u001b[0;32m---> 81\u001b[0m \u001b[43mck\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcustom_check\u001b[49m\u001b[43m(\u001b[49m\u001b[43mdf\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcheck_func\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcheck_func_params\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 82\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m df\n",
101-
"File \u001b[0;32m~/.local/share/virtualenvs/python-311-6zxVKbDJ/lib/python3.11/site-packages/bulwark/checks.py:588\u001b[0m, in \u001b[0;36mcustom_check\u001b[0;34m(df, check_func, *args, **kwargs)\u001b[0m\n\u001b[1;32m 576\u001b[0m \u001b[38;5;250m\u001b[39m\u001b[38;5;124;03m\"\"\"Assert that `check(df, *args, **kwargs)` is true.\u001b[39;00m\n\u001b[1;32m 577\u001b[0m \n\u001b[1;32m 578\u001b[0m \u001b[38;5;124;03mArgs:\u001b[39;00m\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 585\u001b[0m \n\u001b[1;32m 586\u001b[0m \u001b[38;5;124;03m\"\"\"\u001b[39;00m\n\u001b[1;32m 587\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m--> 588\u001b[0m \u001b[43mcheck_func\u001b[49m\u001b[43m(\u001b[49m\u001b[43mdf\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43margs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 589\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mAssertionError\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m e:\n\u001b[1;32m 590\u001b[0m msg \u001b[38;5;241m=\u001b[39m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;132;01m{}\u001b[39;00m\u001b[38;5;124m is not true.\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;241m.\u001b[39mformat(check_func\u001b[38;5;241m.\u001b[39m\u001b[38;5;18m__name__\u001b[39m)\n",
100+
"File \u001b[0;32m~/sandbox/py313/.venv/lib/python3.13/site-packages/bulwark/decorators.py:81\u001b[0m, in \u001b[0;36mCustomCheck.__call__.<locals>.decorated\u001b[0;34m(*args, **kwargs)\u001b[0m\n\u001b[1;32m 78\u001b[0m df \u001b[38;5;241m=\u001b[39m f(\u001b[38;5;241m*\u001b[39margs, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs)\n\u001b[1;32m 79\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39menabled:\n\u001b[1;32m 80\u001b[0m \u001b[38;5;66;03m# differs from BaseDecorator\u001b[39;00m\n\u001b[0;32m---> 81\u001b[0m \u001b[43mck\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcustom_check\u001b[49m\u001b[43m(\u001b[49m\u001b[43mdf\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcheck_func\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcheck_func_params\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 82\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m df\n",
101+
"File \u001b[0;32m~/sandbox/py313/.venv/lib/python3.13/site-packages/bulwark/checks.py:588\u001b[0m, in \u001b[0;36mcustom_check\u001b[0;34m(df, check_func, *args, **kwargs)\u001b[0m\n\u001b[1;32m 576\u001b[0m \u001b[38;5;250m\u001b[39m\u001b[38;5;124;03m\"\"\"Assert that `check(df, *args, **kwargs)` is true.\u001b[39;00m\n\u001b[1;32m 577\u001b[0m \n\u001b[1;32m 578\u001b[0m \u001b[38;5;124;03mArgs:\u001b[39;00m\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 585\u001b[0m \n\u001b[1;32m 586\u001b[0m \u001b[38;5;124;03m\"\"\"\u001b[39;00m\n\u001b[1;32m 587\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m--> 588\u001b[0m \u001b[43mcheck_func\u001b[49m\u001b[43m(\u001b[49m\u001b[43mdf\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43margs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 589\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mAssertionError\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m e:\n\u001b[1;32m 590\u001b[0m msg \u001b[38;5;241m=\u001b[39m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;132;01m{}\u001b[39;00m\u001b[38;5;124m is not true.\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;241m.\u001b[39mformat(check_func\u001b[38;5;241m.\u001b[39m\u001b[38;5;18m__name__\u001b[39m)\n",
102102
"Cell \u001b[0;32mIn[1], line 9\u001b[0m, in \u001b[0;36mlen_longer_than\u001b[0;34m(df, l)\u001b[0m\n\u001b[1;32m 7\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mlen_longer_than\u001b[39m(df, l):\n\u001b[1;32m 8\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mlen\u001b[39m(df) \u001b[38;5;241m<\u001b[39m\u001b[38;5;241m=\u001b[39m l:\n\u001b[0;32m----> 9\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mAssertionError\u001b[39;00m(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mdf is not as long as expected.\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[1;32m 10\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m df\n",
103103
"\u001b[0;31mAssertionError\u001b[0m: len_longer_than is not true."
104104
]
@@ -152,8 +152,8 @@
152152
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
153153
"\u001b[0;31mAssertionError\u001b[0m Traceback (most recent call last)",
154154
"Cell \u001b[0;32mIn[2], line 15\u001b[0m\n\u001b[1;32m 12\u001b[0m df \u001b[38;5;241m=\u001b[39m pd\u001b[38;5;241m.\u001b[39mDataFrame({\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124ma\u001b[39m\u001b[38;5;124m\"\u001b[39m: [\u001b[38;5;241m1\u001b[39m, \u001b[38;5;241m2\u001b[39m, \u001b[38;5;241m3\u001b[39m], \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mb\u001b[39m\u001b[38;5;124m\"\u001b[39m: [\u001b[38;5;241m4\u001b[39m, \u001b[38;5;241m5\u001b[39m, \u001b[38;5;241m6\u001b[39m]})\n\u001b[1;32m 13\u001b[0m df2 \u001b[38;5;241m=\u001b[39m pd\u001b[38;5;241m.\u001b[39mDataFrame({\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124ma\u001b[39m\u001b[38;5;124m\"\u001b[39m: [\u001b[38;5;241m1\u001b[39m, np\u001b[38;5;241m.\u001b[39mnan, \u001b[38;5;241m3\u001b[39m, \u001b[38;5;241m4\u001b[39m], \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mb\u001b[39m\u001b[38;5;124m\"\u001b[39m: [\u001b[38;5;241m4\u001b[39m, \u001b[38;5;241m5\u001b[39m, \u001b[38;5;241m6\u001b[39m, \u001b[38;5;241m7\u001b[39m]})\n\u001b[0;32m---> 15\u001b[0m \u001b[43mappend_a_df\u001b[49m\u001b[43m(\u001b[49m\u001b[43mdf\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mdf2\u001b[49m\u001b[43m)\u001b[49m\n",
155-
"File \u001b[0;32m~/.local/share/virtualenvs/python-311-6zxVKbDJ/lib/python3.11/site-packages/bulwark/decorators.py:24\u001b[0m, in \u001b[0;36mBaseDecorator.__call__.<locals>.decorated\u001b[0;34m(*args, **kwargs)\u001b[0m\n\u001b[1;32m 22\u001b[0m df \u001b[38;5;241m=\u001b[39m f(\u001b[38;5;241m*\u001b[39margs, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs)\n\u001b[1;32m 23\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39menabled:\n\u001b[0;32m---> 24\u001b[0m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcheck_func\u001b[49m\u001b[43m(\u001b[49m\u001b[43mdf\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcheck_func_params\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 25\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m df\n",
156-
"File \u001b[0;32m~/.local/share/virtualenvs/python-311-6zxVKbDJ/lib/python3.11/site-packages/bulwark/checks.py:570\u001b[0m, in \u001b[0;36mmulti_check\u001b[0;34m(df, checks, warn)\u001b[0m\n\u001b[1;32m 568\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m df\n\u001b[1;32m 569\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m error_msgs:\n\u001b[0;32m--> 570\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mAssertionError\u001b[39;00m(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;130;01m\\n\u001b[39;00m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;241m.\u001b[39mjoin(\u001b[38;5;28mstr\u001b[39m(i) \u001b[38;5;28;01mfor\u001b[39;00m i \u001b[38;5;129;01min\u001b[39;00m error_msgs))\n\u001b[1;32m 572\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m df\n",
155+
"File \u001b[0;32m~/sandbox/py313/.venv/lib/python3.13/site-packages/bulwark/decorators.py:24\u001b[0m, in \u001b[0;36mBaseDecorator.__call__.<locals>.decorated\u001b[0;34m(*args, **kwargs)\u001b[0m\n\u001b[1;32m 22\u001b[0m df \u001b[38;5;241m=\u001b[39m f(\u001b[38;5;241m*\u001b[39margs, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs)\n\u001b[1;32m 23\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39menabled:\n\u001b[0;32m---> 24\u001b[0m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcheck_func\u001b[49m\u001b[43m(\u001b[49m\u001b[43mdf\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcheck_func_params\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 25\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m df\n",
156+
"File \u001b[0;32m~/sandbox/py313/.venv/lib/python3.13/site-packages/bulwark/checks.py:570\u001b[0m, in \u001b[0;36mmulti_check\u001b[0;34m(df, checks, warn)\u001b[0m\n\u001b[1;32m 568\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m df\n\u001b[1;32m 569\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m error_msgs:\n\u001b[0;32m--> 570\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mAssertionError\u001b[39;00m(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;130;01m\\n\u001b[39;00m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;241m.\u001b[39mjoin(\u001b[38;5;28mstr\u001b[39m(i) \u001b[38;5;28;01mfor\u001b[39;00m i \u001b[38;5;129;01min\u001b[39;00m error_msgs))\n\u001b[1;32m 572\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m df\n",
157157
"\u001b[0;31mAssertionError\u001b[0m: (4, 'a')"
158158
]
159159
}
@@ -179,9 +179,9 @@
179179
],
180180
"metadata": {
181181
"kernelspec": {
182-
"display_name": "Python 3 (ipykernel)",
182+
"display_name": "Python 3.13 Kernel",
183183
"language": "python",
184-
"name": "python3"
184+
"name": "python313"
185185
},
186186
"language_info": {
187187
"codemirror_mode": {
@@ -193,7 +193,7 @@
193193
"name": "python",
194194
"nbconvert_exporter": "python",
195195
"pygments_lexer": "ipython3",
196-
"version": "3.11.4"
196+
"version": "3.13.0"
197197
},
198198
"latex_envs": {
199199
"LaTeX_envs_menu_present": true,

docs/clean-prep/dask-pipeline.ipynb

+36-41
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,7 @@
7070
"cell_type": "markdown",
7171
"metadata": {},
7272
"source": [
73-
"### 3. Latitude and longitude pairs from a list of cities\n",
74-
"\n",
75-
"<div class=\"alert alert-block alert-info\">\n",
76-
"\n",
77-
"**See also**\n",
78-
"\n",
79-
"* [Location APIs](https://locationiq.com/)\n",
80-
"</div>"
73+
"### 3. Latitude and longitude pairs from a list of cities"
8174
]
8275
},
8376
{
@@ -86,20 +79,15 @@
8679
"metadata": {},
8780
"outputs": [],
8881
"source": [
82+
"from geopy.geocoders import Nominatim\n",
83+
"\n",
8984
"def get_lat_long(address):\n",
90-
" resp = requests.get(\n",
91-
" \"https://eu1.locationiq.org/v1/search.php\",\n",
92-
" params={\"key\": \"92e7ba84cf3465\", \"q\": address, \"format\": \"json\"},\n",
93-
" )\n",
94-
" if resp.status_code != 200:\n",
95-
" print(\"There was a problem with your request!\")\n",
96-
" print(resp.content)\n",
97-
" return\n",
98-
" data = resp.json()[0]\n",
85+
" loc = Nominatim(user_agent=\"Geopy Library\")\n",
86+
" getLoc = loc.geocode(address)\n",
9987
" return {\n",
100-
" \"name\": data.get(\"display_name\"),\n",
101-
" \"lat\": float(data.get(\"lat\")),\n",
102-
" \"long\": float(data.get(\"lon\")),\n",
88+
" \"name\": getLoc.address,\n",
89+
" \"lat\": getLoc.latitude,\n",
90+
" \"long\": getLoc.longitude\n",
10391
" }"
10492
]
10593
},
@@ -111,7 +99,7 @@
11199
{
112100
"data": {
113101
"text/plain": [
114-
"{'name': 'Berlin, 10117, Germany', 'lat': 52.5170365, 'long': 13.3888599}"
102+
"{'name': 'Berlin, Deutschland', 'lat': 52.510885, 'long': 13.3989367}"
115103
]
116104
},
117105
"execution_count": 4,
@@ -154,30 +142,30 @@
154142
{
155143
"data": {
156144
"text/plain": [
157-
"[{'name': 'Seattle, King County, Washington, USA',\n",
145+
"[{'name': 'Seattle, King County, Washington, United States',\n",
158146
" 'lat': 47.6038321,\n",
159-
" 'long': -122.3300624},\n",
160-
" {'name': 'Miami, Miami-Dade County, Florida, USA',\n",
147+
" 'long': -122.330062},\n",
148+
" {'name': 'Miami, Miami-Dade County, Florida, United States',\n",
161149
" 'lat': 25.7741728,\n",
162150
" 'long': -80.19362},\n",
163-
" {'name': 'Berlin, 10117, Germany', 'lat': 52.5170365, 'long': 13.3888599},\n",
151+
" {'name': 'Berlin, Deutschland', 'lat': 52.510885, 'long': 13.3989367},\n",
164152
" {'name': 'Singapore', 'lat': 1.357107, 'long': 103.8194992},\n",
165-
" {'name': 'Wellington, Wellington City, Wellington, 6011, New Zealand',\n",
153+
" {'name': 'Wellington, Wellington City, Wellington, 6011, New Zealand / Aotearoa',\n",
166154
" 'lat': -41.2887953,\n",
167155
" 'long': 174.7772114},\n",
168-
" {'name': 'Beirut, Beirut Governorate, Lebanon',\n",
169-
" 'lat': 33.8959203,\n",
170-
" 'long': 35.47843},\n",
171-
" {'name': 'Beijing, Dongcheng District, Beijing, 100010, China',\n",
172-
" 'lat': 39.906217,\n",
173-
" 'long': 116.3912757},\n",
174-
" {'name': 'Nairobi, Kenya', 'lat': -1.2832533, 'long': 36.8172449},\n",
156+
" {'name': 'بيروت, البسطة التحتا, باشورة, محافظة بيروت, لبنان',\n",
157+
" 'lat': 33.88922645,\n",
158+
" 'long': 35.50255852895232},\n",
159+
" {'name': '北京市, 中国', 'lat': 40.190632, 'long': 116.412144},\n",
160+
" {'name': 'Nairobi, Kenya',\n",
161+
" 'lat': -1.3026148499999999,\n",
162+
" 'long': 36.82884201813725},\n",
175163
" {'name': 'Cape Town, City of Cape Town, Western Cape, 8001, South Africa',\n",
176-
" 'lat': -33.928992,\n",
177-
" 'long': 18.417396},\n",
178-
" {'name': 'Autonomous City of Buenos Aires, Comuna 6, Autonomous City of Buenos Aires, Argentina',\n",
179-
" 'lat': -34.6075682,\n",
180-
" 'long': -58.4370894}]"
164+
" 'lat': -33.9288301,\n",
165+
" 'long': 18.4172197},\n",
166+
" {'name': 'Buenos Aires, Comuna 6, Ciudad Autónoma de Buenos Aires, Argentina',\n",
167+
" 'lat': -34.6083696,\n",
168+
" 'long': -58.4440583}]"
181169
]
182170
},
183171
"execution_count": 6,
@@ -236,7 +224,7 @@
236224
" distance = great_circle_dist(\n",
237225
" issloc.get(\"long\"), issloc.get(\"lat\"), loc.get(\"long\"), loc.get(\"lat\")\n",
238226
" )\n",
239-
" logging.info(\"ISS is ~%dkm from %s\", int(distance), loc.get(\"name\"))\n",
227+
" logging.info(f\"ISS is {int(distance)}km from {loc.get(\"name\")}\")\n",
240228
" return distance"
241229
]
242230
},
@@ -261,6 +249,13 @@
261249
" return td.total_seconds()"
262250
]
263251
},
252+
{
253+
"cell_type": "markdown",
254+
"metadata": {},
255+
"source": [
256+
"The predictions for the `iss-pass` API are unfortunately no longer available, see[Open Notify API Server](http://api.open-notify.org)."
257+
]
258+
},
264259
{
265260
"cell_type": "code",
266261
"execution_count": 11,
@@ -270,13 +265,13 @@
270265
"name": "stderr",
271266
"output_type": "stream",
272267
"text": [
273-
"INFO:root:ISS is ~12639km from Berlin, 10117, Germany\n"
268+
"INFO:root:ISS is 3057km from Berlin, Deutschland\n"
274269
]
275270
},
276271
{
277272
"data": {
278273
"text/plain": [
279-
"12639.759939298825"
274+
"np.float64(3057.10849285221)"
280275
]
281276
},
282277
"execution_count": 11,

docs/clean-prep/deduplicate.ipynb

+7-7
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"\n",
1111
"<div class=\"alert alert-block alert-info\">\n",
1212
"\n",
13-
"**See also**\n",
13+
"**See also:**\n",
1414
"\n",
1515
"* [csvdedupe](https://github.com/dedupeio/csvdedupe) offers a command line interface for Dedupe.\n",
1616
"</div>\n",
@@ -334,7 +334,7 @@
334334
"\n",
335335
"<div class=\"alert alert-block alert-info\">\n",
336336
"\n",
337-
"**See also**\n",
337+
"**See also:**\n",
338338
"\n",
339339
"* [notna](https://pandas.pydata.org/docs/reference/api/pandas.notna.html) for the boolean inverse of [pandas.isna](https://pandas.pydata.org/docs/reference/api/pandas.isna.html)\n",
340340
"* [Series.isna](https://pandas.pydata.org/docs/reference/api/pandas.Series.isna.html) for the missing values in a series\n",
@@ -965,7 +965,7 @@
965965
"\n",
966966
"<div class=\"alert alert-block alert-info\">\n",
967967
"\n",
968-
"**See also**\n",
968+
"**See also:**\n",
969969
"\n",
970970
"[csvdedupe](https://github.com/dedupeio/csvdedupe) provides a command line tool for dedupe.\n",
971971
"</div>\n",
@@ -1027,7 +1027,7 @@
10271027
"\n",
10281028
"<div class=\"alert alert-block alert-info\">\n",
10291029
"\n",
1030-
"**See also**\n",
1030+
"**See also:**\n",
10311031
"\n",
10321032
"* [Missing Data](https://docs.dedupe.io/en/latest/Variable-definition.html#missing-data)\n",
10331033
"</div>"
@@ -1492,9 +1492,9 @@
14921492
],
14931493
"metadata": {
14941494
"kernelspec": {
1495-
"display_name": "Python 3.11 Kernel",
1495+
"display_name": "Python 3.13 Kernel",
14961496
"language": "python",
1497-
"name": "python311"
1497+
"name": "python313"
14981498
},
14991499
"language_info": {
15001500
"codemirror_mode": {
@@ -1506,7 +1506,7 @@
15061506
"name": "python",
15071507
"nbconvert_exporter": "python",
15081508
"pygments_lexer": "ipython3",
1509-
"version": "3.11.4"
1509+
"version": "3.13.0"
15101510
},
15111511
"latex_envs": {
15121512
"LaTeX_envs_menu_present": true,

0 commit comments

Comments
 (0)