Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:
uv run quarto render --execute
env:
# This forces Quarto to use the Python inside your uv venv
QUARTO_PYTHON: .venv/bin/python
QUARTO_PYTHON: ${{ github.workspace }}/.venv/bin/python


- name: Check if there is a parent commit
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ jobs:
uv run quarto render --execute
env:
# This forces Quarto to use the Python inside your uv venv
QUARTO_PYTHON: .venv/bin/python
QUARTO_PYTHON: ${{ github.workspace }}/.venv/bin/python

- name: success
run: |
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ To make changes:
1. create a new branch
2. install the Python environment or alternatively build and work in the docker image (which comes with the Python environment)
3. make your content changes, amending the Python environment as necessary (eg add packages via `uv add <packagename>`)
4. Check your changes look right with `uv run quarto render --execute` to render the book, and `uv run python -m http.server -d _book 8000` to read it locally
4. Check your changes look right with `uv run quarto render --execute` to render the book, and `uv run python -m http.server -d _book 8000` to read it locally then head to "http://localhost:8000" to see it.
5. run pre-commit using `uv run pre-commit run --all-files`
6. if the checks clear, commit your change(s)
7. make a pull request
Expand Down
4 changes: 3 additions & 1 deletion _quarto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ book:
- part: "End Matter"
chapters:
- contributing.qmd
- zreferences.qmd
- references.qmd

bibliography: references.bib
csl: csl/chicago-author-date.csl
Expand All @@ -159,3 +159,5 @@ format:
execute:
freeze: auto
error: false

jupyter: python3
4 changes: 2 additions & 2 deletions auto-office.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@
"metadata": {
"celltoolbar": "Tags",
"kernelspec": {
"display_name": "Python 3.10.12 ('codeforecon')",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -232,7 +232,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.12"
"version": "3"
},
"vscode": {
"interpreter": {
Expand Down
2 changes: 1 addition & 1 deletion code-advanced.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -809,7 +809,7 @@
"metadata": {
"celltoolbar": "Tags",
"kernelspec": {
"display_name": "codeforecon",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand Down
2 changes: 1 addition & 1 deletion code-advcd-best-practice.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1072,7 +1072,7 @@
"metadata": {
"celltoolbar": "Tags",
"kernelspec": {
"display_name": "Python 3.10.12 ('codeforecon')",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand Down
3 changes: 2 additions & 1 deletion code-basics.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1683,7 +1683,8 @@
"main_language": "python"
},
"kernelspec": {
"display_name": "Python 3.8.12 64-bit ('codeforecon': conda)",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
Expand Down
2 changes: 1 addition & 1 deletion code-further-advanced.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1169,7 +1169,7 @@
"metadata": {
"celltoolbar": "Tags",
"kernelspec": {
"display_name": "Python 3.10.12 ('codeforecon')",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand Down
2 changes: 1 addition & 1 deletion code-where.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@
"metadata": {
"celltoolbar": "Tags",
"kernelspec": {
"display_name": "Python 3.10.12 ('codeforecon')",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand Down
6 changes: 3 additions & 3 deletions coding-for-economists-quickstart.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -793,9 +793,9 @@
"metadata": {
"celltoolbar": "Tags",
"kernelspec": {
"display_name": "codeforecon",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "codeforecon"
"name": "python3"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -807,7 +807,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.6"
"version": "3"
}
},
"nbformat": 4,
Expand Down
2 changes: 1 addition & 1 deletion craft-technical-reports.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ We can refer back to this figure later using @fig-error.

To generate your bibliography anywhere other than the end of the document, you'll need to use

::: {#refs}
::: {{#refs}}
:::

And this leaves you free to have your appendix separate.
Expand Down
2 changes: 1 addition & 1 deletion data-advanced.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,7 @@
"metadata": {
"celltoolbar": "Tags",
"kernelspec": {
"display_name": "codeforecon",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand Down
2 changes: 1 addition & 1 deletion data-analysis-quickstart.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@
"metadata": {
"celltoolbar": "Tags",
"kernelspec": {
"display_name": "codeforecon",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand Down
2 changes: 1 addition & 1 deletion data-categorical.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@
"main_language": "python"
},
"kernelspec": {
"display_name": "codeforecon",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand Down
2 changes: 1 addition & 1 deletion data-databases.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +787,7 @@
"main_language": "python"
},
"kernelspec": {
"display_name": "codeforecon",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand Down
2 changes: 1 addition & 1 deletion data-exploratory-analysis.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "codeforecon",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand Down
26 changes: 14 additions & 12 deletions data-extraction.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@
"id": "698acfdc",
"metadata": {},
"source": [
"And, because it's also a really useful one, let's also see how to use **pandas-datareader** to access World Bank data."
"And, because it's also a really useful one, let's also see how to use **wbgapi** to access World Bank data."
]
},
{
Expand All @@ -197,22 +197,24 @@
"source": [
"# World Bank CO2 equivalent emissions (metric tons per capita)\n",
"# https://data.worldbank.org/indicator/EN.GHG.ALL.PC.CE.AR5\n",
"# World Bank pop\n",
"# https://data.worldbank.org/indicator/SP.POP.TOTL\n",
"# country and region codes at http://api.worldbank.org/v2/country\n",
"import textwrap\n",
"\n",
"from pandas_datareader import wb\n",
"import wbgapi as wb\n",
"\n",
"df = wb.download( # download the data from the world bank\n",
" indicator=\"EN.GHG.ALL.PC.CE.AR5\", # indicator code\n",
" country=[\"US\", \"CHN\", \"IND\", \"Z4\", \"Z7\"], # country codes\n",
" start=2019, # start year\n",
" end=2019, # end year\n",
"indicator_code = \"EN.GHG.ALL.PC.CE.AR5\"\n",
"df = (\n",
" wb.data.DataFrame(\n",
" indicator_code,\n",
" [\"USA\", \"CHN\", \"IND\", \"EAS\", \"ECS\"], # country and region codes\n",
" time=range(2019, 2020),\n",
" labels=True,\n",
" )\n",
" .rename(columns={\"Country\": \"country\", \"YR2019\": indicator_code})\n",
" .reset_index(drop=True)\n",
")\n",
"df = df.reset_index() # remove country as index\n",
"df[\"country\"] = df[\"country\"].apply(lambda x: textwrap.fill(x, 10)) # wrap long names\n",
"df = df.sort_values(\"EN.GHG.ALL.PC.CE.AR5\") # re-order\n",
"df = df.sort_values(indicator_code) # re-order\n",
"df.head()"
]
},
Expand Down Expand Up @@ -572,7 +574,7 @@
"main_language": "python"
},
"kernelspec": {
"display_name": "codeforecon",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand Down
2 changes: 1 addition & 1 deletion data-intro.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1468,7 +1468,7 @@
"metadata": {
"celltoolbar": "Tags",
"kernelspec": {
"display_name": "codeforecon",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand Down
2 changes: 1 addition & 1 deletion data-joining-data.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@
"main_language": "python"
},
"kernelspec": {
"display_name": "codeforecon",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand Down
2 changes: 1 addition & 1 deletion data-missing-values.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@
"main_language": "python"
},
"kernelspec": {
"display_name": "codeforecon",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand Down
2 changes: 1 addition & 1 deletion data-numbers.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -782,7 +782,7 @@
"main_language": "python"
},
"kernelspec": {
"display_name": "codeforecon",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand Down
2 changes: 1 addition & 1 deletion data-spreadsheets.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@
"main_language": "python"
},
"kernelspec": {
"display_name": "codeforecon",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand Down
2 changes: 1 addition & 1 deletion data-transformation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -956,7 +956,7 @@
"metadata": {
"celltoolbar": "Tags",
"kernelspec": {
"display_name": "codeforecon",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand Down
2 changes: 1 addition & 1 deletion econmt-bayes-bambi.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "codeforecon",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand Down
3 changes: 2 additions & 1 deletion econmt-bayesian.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,8 @@
"hash": "c4570b151692b3082981c89d172815ada9960dee4eb0bedb37dc10c95601d3bd"
},
"kernelspec": {
"display_name": "Python 3.10.12 64-bit ('codeforecon': conda)",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
Expand Down
2 changes: 1 addition & 1 deletion econmt-diagnostics.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,7 @@
"metadata": {
"celltoolbar": "Tags",
"kernelspec": {
"display_name": "codeforecon",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand Down
2 changes: 1 addition & 1 deletion econmt-generalised-models.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,7 @@
"metadata": {
"celltoolbar": "Tags",
"kernelspec": {
"display_name": "Python 3.8.13 ('codeforecon')",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand Down
3 changes: 2 additions & 1 deletion econmt-probability-random.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,8 @@
"hash": "e82e9306cec5f3813db66e68c531c869f324183486c55e9589deb7f101067873"
},
"kernelspec": {
"display_name": "Python 3.10.12 64-bit ('codeforecon': conda)",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
Expand Down
2 changes: 1 addition & 1 deletion econmt-regression.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -936,7 +936,7 @@
"metadata": {
"celltoolbar": "Tags",
"kernelspec": {
"display_name": "codeforecon",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand Down
2 changes: 1 addition & 1 deletion econmt-statistics.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -869,7 +869,7 @@
"metadata": {
"celltoolbar": "Tags",
"kernelspec": {
"display_name": "Python 3.10.12 ('codeforecon')",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand Down
2 changes: 1 addition & 1 deletion geo-intro.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1239,7 +1239,7 @@
"metadata": {
"celltoolbar": "Tags",
"kernelspec": {
"display_name": "codeforecon",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand Down
2 changes: 1 addition & 1 deletion geo-vis.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -758,7 +758,7 @@
"metadata": {
"celltoolbar": "Tags",
"kernelspec": {
"display_name": "codeforecon",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand Down
4 changes: 2 additions & 2 deletions macro-models.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
"metadata": {
"celltoolbar": "Tags",
"kernelspec": {
"display_name": "codeforecon",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -90,7 +90,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.12"
"version": "3"
}
},
"nbformat": 4,
Expand Down
Loading
Loading