Skip to content

Commit

Permalink
update introduction (#75)
Browse files Browse the repository at this point in the history
  • Loading branch information
jelletreep authored Sep 27, 2023
1 parent 954ce61 commit d774cfb
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 11 deletions.
Binary file added book/images/jupyter_example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 5 additions & 5 deletions book/installation-and-setup.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,12 @@ If you installed Anaconda, you can launch a notebook in two ways:

::: {.panel-tabset}
## Command line (Terminal)
1. Navigate to the `data` directory:<br>
1. Navigate to the `python-workshop` directory:<br>
**Unix shell**<br>
If you're using a Unix shell application, such as Terminal app in macOS, Console or Terminal
in Linux, or [Git Bash][gitbash] on Windows, execute the following command:
```{bash}
cd ~/Desktop/python-workshop/data
cd ~/Desktop/python-workshop
```

**Command Prompt (Windows)**<br>
Expand All @@ -117,7 +117,7 @@ If you installed Anaconda, you can launch a notebook in two ways:
<kbd>Return</kbd>. In the Command Prompt, use the following command to navigate to
the `data` folder:
```{sh}
cd /D %userprofile%\Desktop\python-workshop\data
cd /D %userprofile%\Desktop\python-workshop
```
2. Start Jupyter server:<br>
**Unix shell**
Expand All @@ -139,8 +139,8 @@ Make your choice and click "Ok, and don't show again" button.
2. Find the "Notebook" tab and click on the "Launch" button.
Anaconda will open a new browser window or tab with a Notebook Dashboard showing you the
contents of your Home (or User) folder.
3. Navigate to the `data` directory by clicking on the directory names leading to it.
`Desktop`, `python-workshop`, then `data`:
3. Navigate to the `python-workshop` directory by clicking on the directory names leading to it.
`Desktop` and then `python-workshop`:
4. Launch the notebook by clicking on the "New" button and then selecting "Python 3".
:::

Expand Down
25 changes: 19 additions & 6 deletions book/introduction.qmd
Original file line number Diff line number Diff line change
@@ -1,11 +1,24 @@
# Introduction

What is Python?
Introduce Python as a programming language.

Why do we like it so much?
Most popular programming language for open source research projects @ UU (see [SWORDS-UU](https://github.com/UtrechtUniversity/SWORDS-UU/blob/main/collect_variables/analyze_metrics.ipynb)).
## What is Python?
Python is a general-purpose programming language that is very popular in the scientific community. At Utrecht University it is the most popular programming language for open source research projects @ UU (see [SWORDS-UU](https://github.com/UtrechtUniversity/SWORDS-UU/blob/main/collect_variables/analyze_metrics.ipynb)).

![Programming languages by user](images/programming_languages.png)

Introduction Jupyter, perhaps a tour of the Jupyter environment.
Python is popular due to its readability, ease of use, its large community, and its large ecosystem of packages that can be used for a large variety of tasks, ranging from data analysis, modelling, simulation, machine learning to web development.

Python is open source, which means that it is free to use and that the source code is available for anyone to inspect and modify. This makes it easy to install Python on any computer, and e.g. share code with others or scale up your computations to a high performance computing system.

## Scope of this course
Learning to program is a skill that takes time and practice. This course will not make you an expert programmer, but it will give you a small foundation to build on. The course will focus on the basics of the Python language, and simple data handling and visualization with the Pandas Python library. This will be enough to demonstrate the power of Python and hopefully inspire you to learn more. After the course you will have some basic knowledge to get started and we will be available during the [RDM walk in hours](https://www.uu.nl/en/research/research-data-management/workshops/walk-in-hours-research-data-and-software) and the [Programming cafe](https://www.uu.nl/en/research/research-data-management/workshops/programming-cafe) to help you continue your learning journey and start using Python in your own research.

## Jupyter Notebooks
There are many programs that can be used to edit and run Python code. This course will use Jupyter Notebooks. Jupyter Notebooks are a way to combine text, code, and output in a single document. Jupyter Notebooks are a great way to learn Python, as you can run code in small chunks and immediately see the results. But this doesn't mean Jupyter Notebooks are only for beginners. Jupyter Notebooks are used by many professional programmers and scientists to share their work and even do computationally expensive analyses.

See below how a Jupyter Notebook looks like. The notebook is divided in text cells and code cells. The code cell contains Python code, which can be executed by pressing the 'play' button in the toolbar or by pressing `Shift + Enter`. The output of the code is shown below the code cell. The text cells contain text written in Markdown, which is a simple way to format text. You can edit the text by double clicking on the text cell. To render the text again, press `Shift + Enter`.

[![Jupyter Notebook](images/jupyter_example.png)](https://jupyter.org/)
*Example of a Jupyter Notebook*

## Course setup
During the course we will be introducing concepts in short lectures where we will demonstrate by means of 'live coding'. This means that we will be writing code in a Jupyter Notebook and explain what we are doing. You can follow along by opening an empty notebook, typing along and running the code yourself. In between the lectures we will provide you with exercises to practice what you have learned.

0 comments on commit d774cfb

Please sign in to comment.