Skip to content
This repository was archived by the owner on Aug 6, 2025. It is now read-only.
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
9 changes: 0 additions & 9 deletions book/01/Exercises/bug_report.md

This file was deleted.

10 changes: 0 additions & 10 deletions book/02/Exercises/bug_report.md

This file was deleted.

2 changes: 1 addition & 1 deletion book/03/Exercises/01.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
":class: tip, dropdown\n",
"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",
"\n",
"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",
"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",
"`````"
]
},
Expand Down
9 changes: 0 additions & 9 deletions book/03/Exercises/bug_report.md

This file was deleted.

9 changes: 0 additions & 9 deletions book/04/Exercises/bug_report.md

This file was deleted.

9 changes: 0 additions & 9 deletions book/05/Exercises/bug_report.md

This file was deleted.

9 changes: 0 additions & 9 deletions book/06/Exercises/bug_report.md

This file was deleted.

9 changes: 0 additions & 9 deletions book/07/Exercises/bug_report.md

This file was deleted.

4 changes: 0 additions & 4 deletions book/Intro_in_ToC.md

This file was deleted.

22 changes: 9 additions & 13 deletions book/Python_Toolbox.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
(toolbox)=
# Python Toolbox

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!
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.

**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!

## Interactive Pages

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.

(calculator)=
## IPython: Your Primary Python Calculator
Expand All @@ -20,7 +27,7 @@ The simple exercise above should be all you need to get started with this course
:class: tip, dropdown
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).

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)).
Remember that most pages in this course can also be run interactively using the {fa}rocket icon above (read more about it [here](toolbox)).
`````

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.
Expand All @@ -29,17 +36,6 @@ All exercises in this course can be completed using only the Python Calculator.
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.
```

(nb-links)=
## Interactive Jupyter Notebooks

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.

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!

```{note}
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.
```

## Anaconda: Python on Your Computer

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!
5 changes: 3 additions & 2 deletions book/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ html:
favicon : "figures/favicon.ico"
google_analytics_id: G-8FZWSB5TQP
home_page_in_navbar: false
use_issues_button: false
use_repository_button: false
use_issues_button: true
use_repository_button: true
use_edit_page_button: true
# announcement: "⚠️ This is not the final version of the book! The new version will be ready by July 1.⚠️"
extra_navbar: |
<div>
Expand Down
13 changes: 3 additions & 10 deletions book/_toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
# Learn more at https://jupyterbook.org/customize/toc.html

format: jb-book
root: intro
root: introduction.md
parts:
- caption: Introduction
chapters:
- file: Intro_in_ToC.md
- file: intro.md
title: Course Overview
- file: Python_intro.md
title: Programming and Python
Expand All @@ -16,32 +16,25 @@ parts:
- file: 01/Theory/01.ipynb
sections:
- file: 01/Exercises/01.ipynb
- file: 01/Exercises/bug_report.md
- file: 02/Theory/01.ipynb
sections:
- file: 02/Exercises/01.ipynb
- file: 02/Exercises/bug_report.md
- file: 03/Theory/01.ipynb
sections:
- file: 03/Exercises/01.ipynb
- file: 03/Exercises/bug_report.md
- file: 03/Exercises/01.ipynb
- file: 04/Theory/01.ipynb
sections:
- file: 04/Exercises/01.ipynb
- file: 04/Exercises/bug_report.md
- file: 05/Theory/01.ipynb
sections:
- file: 05/Exercises/01.ipynb
- file: 05/Exercises/02.ipynb
- file: 05/Exercises/bug_report.md
- file: 06/Theory/01.ipynb
sections:
- file: 06/Exercises/01.ipynb
- file: 06/Exercises/bug_report.md
- file: 07/Theory/01.ipynb
sections:
- file: 07/Exercises/01.ipynb
- file: 07/Exercises/bug_report.md
- file: 08/sympy
title: 8. SymPy
- file: 09/intro.md
Expand Down
2 changes: 2 additions & 0 deletions book/intro.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Python for Engineers

% The content of this page is defined in a separate file in order to have it appear in the home page of the book (not listed in ToC), as well as to have it listed directly in the ToC in the Introduction Part

```{include} ./intro_text.md
```
13 changes: 10 additions & 3 deletions book/intro_text.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
% The content of this page is included in two places: the home page of the book introduction.md (not listed in ToC), as well as in the Introduction Part of the book into.md (listed in ToC)

Welcome to **Python for Engineers**. We're excited to have you join us in this self-paced online course, which is designed to improve your Python skills as well as your understanding of computer programming---especially for applications in engineering and the applied geosciences. Believe it or not, as long as you are using a modern internet browser, you can take complete this course without installing a single piece of extra software!
<!-- Join us to automate tasks, analyze data, visualize information, and develop efficient algorithms. Embrace this opportunity to expand your horizons and unlock new possibilities in your academic and professional journey. -->

```{admonition} What do we mean by "engineers"?
:class: dropdown
This course was originally developed for students in the fields of: Civil Engineering, Environmental Engineering, Applied Earth Sciences and Construction Management and Engineering. These programs are part of the faculty of Civil Engineering and Geosciences at Delft University of Technology in the Netherlands. We try to draw on examples from these fields, but the course contents should be relevant for any engineering or applied geoscience discipline.
```

You will find this course especially helpful if you have learned programming in another language before or if you would just like to do a refresher course. If you have never taken a programming course and are completely new to programming, it may still be useful, but will also require some extra work. If you find the course difficult, we recommend you consider one of the many free online introduction to computer programming courses that uses the Python language (try searching on EdX or Udacity, for example, but note that we do not require you to pay for a certificate). The course material [Exploratory Computing with Python](https://mbakker7.github.io/exploratory_computing_with_python/) will illustrate pre-requisite topics, but, unlike EdX or Udacity, it is entirely self-study. As an additional study material for learning Python basics, we advise the open source book <a href="https://greenteapress.com/wp/think-python-2e/">"Think Python 2nd Edition" by Allen B. Downey</a>. It describes in more detail what is covered in this course.
You will find this course especially helpful if you have learned programming in another language before or if you would just like to do a refresher course. If you have never taken a programming course and are completely new to programming, it may still be useful, but will also require some extra work. If you find the course difficult, we recommend you consider one of the many free online introduction to computer programming courses that uses the Python language (try searching on EdX or Udacity, for example). The course material [Exploratory Computing with Python](https://teachbooks.io/exploratory_computing_with_python/) is an excellent resource that provides a gentler introduction than this one, but, unlike EdX or Udacity, it is entirely self-study. Finally, as an additional study material for learning Python basics, we advise the open source book <a href="https://greenteapress.com/wp/think-python-2e/">"Think Python 2nd Edition" by Allen B. Downey</a>. It describes in more detail what is covered in this course.

```{admonition} Note to TU Delft Students (MSc programs)
:class: dropdown
Expand Down Expand Up @@ -34,4 +35,10 @@ It's really quite simple: read through the 3 Chapters in the Introduction part,

## Feedback and Corrections

We appreciate help to identify mistakes in our course. Links will soon be posted here to help us fix them, as well as a short survey to see if you liked the course!
We are always interested in improving this online book and appreciate help to identify mistakes, as well as general suggestions. The best way to do this is by using the buttons at the top right of each page which link directly to the GitHub repository where this website is hosted. In particular:
- the "Suggest Edit" option allows you to make a correction or suggestion directly (as a Git "commit")
- the "Issue" option allows you to report a general problem or suggest a new feature

Note that you will need a GitHub account to do this. Once your edit or Issue is submitted, we will incorporate any changes into the book using a Pull Request, and you will be notified via GitHub when this is done.

If this doesn't work for you, feel free to simply send an email to R.C.Lanzafame@tudelft.nl.
6 changes: 6 additions & 0 deletions book/introduction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Python for Engineers

% The content of this page is defined in a separate file in order to have it appear in the home page of the book (not listed in ToC), as well as to have it listed directly in the ToC in the Introduction Part

```{include} ./intro_text.md
```
Loading