Skip to content

Commit 8a06484

Browse files
committed
fix(bugs): a few broken links
1 parent 4289e5b commit 8a06484

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

clean-modular-code/activity-2/clean-code-part-2.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,8 @@ combined_papers_df = pd.concat([papers_df_1, papers_df_2], axis=0)
155155
combined_papers_df.shape
156156
```
157157

158+
+++ {"editable": true, "slideshow": {"slide_type": ""}}
159+
158160
## On your own 1
159161

160162
If you get through the above activity with time to spare, here are a few additional tasks that you can work on.

clean-modular-code/pep8-package-imports.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ kernelspec:
1111
name: python3
1212
---
1313

14+
+++ {"editable": true, "slideshow": {"slide_type": ""}}
15+
1416
# Best Practices for Importing Python Packages In Scientific Code
1517

1618
There are a set of best practices that you should follow when importing **Python** packages in your code. These best practices are outlined in the <a href="https://www.python.org/dev/peps/pep-0008/#imports" target="_blank">PEP 8 guidelines</a> and apply to both **Python** scripts and to working in **Jupyter Notebook** files.
@@ -21,12 +23,12 @@ It is good practice to import all of the packages that you will need at the top
2123

2224
This allows anyone looking at your code to immediately know what packages they need to have installed in order to successfully run the code. This rule also follows the PEP 8 conventions for **Python** code.
2325

24-
<figure>
25-
<a href="/images/jupyter/import-packages-first-cell.png">
26-
<img src="/images/jupyter/import-packages-first-cell.png" alt= "Jupyter Notebook with the first code cell importing the numpy package (and many others) to be used with abbreviations or aliases (e.g. np)."></a>
27-
<figcaption> Jupyter Notebook with the first code cell importing the numpy package (and many others) to be used with abbreviations or aliases (e.g. np for numpy).
28-
</figcaption>
29-
</figure>
26+
```python
27+
import os
28+
29+
import pandas as pd
30+
import numpy as np
31+
```
3032

3133
Once you have imported all of the packages that you need to run your code in a script, you have access to all of the functions and classes defined in each package.
3234

0 commit comments

Comments
 (0)