Skip to content

Commit bae0fde

Browse files
committed
Refactor constant names.
1 parent 2dde404 commit bae0fde

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

notebooks/1b_handling.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,9 +148,9 @@
148148
"outputs": [],
149149
"source": [
150150
"# An example of using dictionaries.\n",
151-
"_COLUMNS = {\"count_of_employees\": \"size_emp\"}\n",
151+
"COLUMNS = {\"count_of_employees\": \"size_emp\"}\n",
152152
"\n",
153-
"firmyear = firmyear.rename(columns=_COLUMNS)"
153+
"firmyear = firmyear.rename(columns=COLUMNS)"
154154
]
155155
},
156156
{

notebooks/2b_retrieval1.ipynb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@
211211
"# Note: when in doubt, get everything you might possibly use.\n",
212212
"# It's easier to drop stuff than to re-scrape everything.\n",
213213
"\n",
214-
"_METAS = [\n",
214+
"METAS = [\n",
215215
" \"article:published_time\",\n",
216216
" \"article:modified_time\",\n",
217217
" \"og:title\",\n",
@@ -231,7 +231,7 @@
231231
"# This loop populates a dict with each of the meta attributes above and its content.\n",
232232
"# Discussion: why is this try/except necessary? What happens if we remove it?\n",
233233
"pr_data_1 = {}\n",
234-
"for meta in _METAS:\n",
234+
"for meta in METAS:\n",
235235
" try:\n",
236236
" prop = pr_soup_1.find(\"meta\", property=meta)[\"property\"]\n",
237237
" content = pr_soup_1.find(\"meta\", property=meta)[\"content\"]\n",
@@ -306,7 +306,7 @@
306306
"source": [
307307
"def get_data_from_soup(soup):\n",
308308
" data = {}\n",
309-
" for meta in _METAS:\n",
309+
" for meta in METAS:\n",
310310
" try:\n",
311311
" prop = soup.find(\"meta\", property=meta)[\"property\"]\n",
312312
" content = soup.find(\"meta\", property=meta)[\"content\"]\n",

0 commit comments

Comments
 (0)