You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 6, 2025. It is now read-only.
Copy file name to clipboardExpand all lines: book/03/Exercises/01.ipynb
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -56,7 +56,7 @@
56
56
":class: tip, dropdown\n",
57
57
"Click this <a href=\"https://tudelft-citg.github.io/learn-python-calculator/repl/index.html?toolbar=1&kernel=python&code=import pandas as pd; import data.check_answers as check; print('You may begin!')\" target=\"_blank\">link</a> and wait until the message \"<tt>You may begin!</tt>\" is printed to start evaluating code. More information about this tool can be found [here](calculator). \n",
58
58
"\n",
59
-
"Remember that all pages in this course can also be opened as an interactive notebook via Binder or Colab using the {fa}rocket icon above (read more about it [here](nb-links)).\n",
59
+
"Remember that most pages in this course can also be run interactively using the {fa}rocket icon above (read more about it [here](toolbox)).\n",
This page describes how you will interact with Python in this course, specifically via IPython and Jupyter Notebooks. **IPython** is an interactive Python interpreter that adds feautures that are useful for engineering, such as command history or inline display of figures. As you will see below, you can enter multiple lines of text and evaluate them at once; this is often referred to as a *cell* of code. In a nutshell, if you string many of these cells together into a single digital document, you more or less end up with a **Jupyter Notebook**; this leverages the power of IPython by allowing you to type, run and save the cells in any order, as well as type formatted text in between. Together, these two tools make up our toolbox for this course, and, as you will see, both of them can run in your internet browser, so there is no need to install special software!
4
+
This page describes several ways to write and execute Python code, some of which don't require any installation on your computer and work entirely in a web browser! These approaches are described in the sections below, and are based on the tools IPython and Jupyter Notebooks.
5
+
6
+
**IPython** is an interactive Python interpreter that adds features that are useful for engineering, such as command history or inline display of figures. As you will see below, you can enter multiple lines of text and evaluate them at once; this is often referred to as a *cell* of code. In a nutshell, if you string many of these cells together into a single digital document, you more or less end up with a **Jupyter Notebook**; this leverages the power of IPython by allowing you to type, run and save the cells in any order, as well as type formatted text in between. Together, these two tools make up our toolbox for this course, and, as you will see, both of them can run in your internet browser, so there is no need to install special software!
7
+
8
+
## Interactive Pages
9
+
10
+
This course is powered by a special software (the [Sphinx-Thebe](https://github.com/executablebooks/sphinx-thebe) that allows you to run Python code in your browser and gives you an experience that is more or less identical the the "standard" Jupyter Notebook experience you would have on your own computer if you installed the dedicated software. You can access this tool by clicking on the rocket icon ({fa}`rocket`) at the top right of a page where this is enabled.
4
11
5
12
(calculator)=
6
13
## IPython: Your Primary Python Calculator
@@ -20,7 +27,7 @@ The simple exercise above should be all you need to get started with this course
20
27
:class: tip, dropdown
21
28
Click this <a href="https://tudelft-citg.github.io/learn-python-calculator/repl/index.html?toolbar=1&kernel=python&code=print('You may begin!')" target="_blank">link</a> and wait until the message "<tt>You may begin!</tt>" is printed to start evaluating code. More information about this tool can be found [here](calculator).
22
29
23
-
Remember that all pages in this course can also be opened as an interactive notebook via Binder or Colab using the {fa}rocket icon above (read more about it [here](nb-links)).
30
+
Remember that most pages in this course can also be run interactively using the {fa}rocket icon above (read more about it [here](toolbox)).
24
31
`````
25
32
26
33
All exercises in this course can be completed using only the Python Calculator. We hope you find it to be a simple but useful way to practice and learn the Python programming language.
@@ -29,17 +36,6 @@ All exercises in this course can be completed using only the Python Calculator.
29
36
A special instance of the Python Calculator is set up for each page which pre-loads a few packages needed to complete the exercise. Make sure you use link that is on the page of the exercises you are working on.
30
37
```
31
38
32
-
(nb-links)=
33
-
## Interactive Jupyter Notebooks
34
-
35
-
Although the Python Calculator is all that is needed, it is nice to be able to explore Python by using a Jupyter Notebook. There are two ways these notebooks have been set up to avoid the need for special software, namely: Binder and Colab. These notebooks allow you to run your script in cells, where each cell is equivalent to those in the IPython interpreter. Running cell blocks is more convenient for data analysis since sometimes you just need to change a small part of your code or add some explanation, math formulas, or figures. Therefore, re-running only the corresponding cell is much more efficient.
36
-
37
-
No example is provided here, but you can access this tool elsewhere in this course using the links under the rocket icon ({fa}`rocket`) at the top right of the page. Although Colab is the fastest and most reliable service, it is provided by Google, and the data privacy policy is not always clear. As such, Binder is provided as an alternative, but note that sometimes it takes a while for the notebook to load. Both of these options do not allow you to save your work in the notebook (unless you download a file or link a Google account), so be careful when closing a tab!
38
-
39
-
```{note}
40
-
Due to the way this website is generated from Jupyter Notebooks, when you view the files in Binder or Colab, you will notice oddly formatted text cells: this is the code to generate features like this note on the website, which do not render properly in the notebook environment. You can simply ignore them. In addition, whereas the Python Calculator windows will load properly, there are special pieces of code that need to be run in the notebooks to get them to work properly. Simply follow the instructions in the commented code cell near the top of the notebook, which involves uncommenting one or two lines and executing the cell.
41
-
```
42
-
43
39
## Anaconda: Python on Your Computer
44
40
45
41
If you want to explore Python programming and Jupyter ecosystems beyond the exercises covered in this course, it might be worthwhile to install a Python distribution on your own computer. The most common and easiest way to do this is with [Anaconda](https://www.anaconda.com/download). Installation instructions are not included in this course, but you can find plenty of website of videos that cover this, as well as using the Anaconda Navigator to open a Jupyter Lab or Jupyter Notebook environment. Most of the pages in this online textbook can be downloaded in the form of a Jupyter Notebook file (a file ending with `.ipynb`): open it via one of the Jupyter environments and you are ready to go!
0 commit comments