{ "cells": [ { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "skip" } }, "source": [ "# Motivation" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "## Why Python?" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "fragment" } }, "source": [ "" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "skip" } }, "source": [ "> Python is an unusual case for being both one of the **most visited** tags on Stack Overflow and one of the **fastest-growing** ones. (Incidentally, it is also accelerating! Its year-over-year growth has become faster each year since 2013). Source: [StackOverflow Blog](https://stackoverflow.blog/2017/09/06/incredible-growth-python/)" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "Python...\n", "- is beginner friendly\n", "- flexible\n", "- readable\n", "- has a big onliny community\n", "- is a first-class tool for scientific computing tasks\n", "- is used in Remote Sensing, Machine Learning, Big Data Analysis, Image Processing , Data Visualization\n", "- is the 2nd most demanded programming skill (in the US)\n", "- is the 2nd best paid programming skill (> 105'000$ in the US)\n", "- is heavily used at large companies like Google & Facebook but also at NASA, ESA, EUMETSAT, etc." ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "## Aim of the course\n", "\n", "At the end of this course you will be able ..." ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "slideshow": { "slide_type": "skip" }, "tags": [ "hidecode" ] }, "outputs": [], "source": [ "import pandas as pd\n", "import numpy as np\n", "import xarray as xr\n", "import satpy\n", "import matplotlib.pyplot as plt\n", "from scipy.optimize import curve_fit\n", "from matplotlib.pyplot import rcParams\n", "import warnings\n", "\n", "rcParams['figure.figsize'] = 8,6\n", "rcParams['font.size'] = 14\n", "\n", "def func(x,a):\n", " return np.exp(x) + a\n", "\n", "xdata = np.linspace(0, 4, 50)\n", "y = func(xdata,5)\n", "y_noise = 5.2 * np.random.normal(size=xdata.size)\n", "ydata = y + y_noise\n", "\n", "warnings.filterwarnings('ignore')" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "... to work with the basic concepts of Python:" ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "slideshow": { "slide_type": "-" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "0\n", "1\n", "2\n", "3\n", "4\n", "fünf\n", "6\n", "7\n", "8\n", "9\n" ] } ], "source": [ "for i in range(10):\n", " if i==5:\n", " print(\"fünf\")\n", " else:\n", " print(i)" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "... to read, interpret and manipulate your scientific data with the standard Python tools for data science (numpy, scipy, pandas):" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "scrolled": true, "slideshow": { "slide_type": "-" } }, "outputs": [ { "data": { "text/html": [ "
\n", " | visibility | \n", "air_temperature | \n", "dewpoint | \n", "wind_direction | \n", "wind_speed | \n", "air_pressure | \n", "cloud_height | \n", "cloud_cover | \n", "
---|---|---|---|---|---|---|---|---|
time | \n", "\n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " |
2015-01-01 00:20:00 | \n", "2800 | \n", "1.0 | \n", "1.0 | \n", "0.0 | \n", "0.0 | \n", "1036.0 | \n", "200.0 | \n", "OVC | \n", "
2015-01-01 00:50:00 | \n", "1500 | \n", "1.0 | \n", "1.0 | \n", "0.0 | \n", "0.0 | \n", "1036.0 | \n", "100.0 | \n", "OVC | \n", "
2015-01-01 01:20:00 | \n", "1000 | \n", "1.0 | \n", "1.0 | \n", "0.0 | \n", "0.0 | \n", "1036.0 | \n", "100.0 | \n", "OVC | \n", "
2015-01-01 01:50:00 | \n", "700 | \n", "1.0 | \n", "1.0 | \n", "0.0 | \n", "0.0 | \n", "1036.0 | \n", "NaN | \n", "NaN | \n", "
2015-01-01 02:20:00 | \n", "600 | \n", "1.0 | \n", "1.0 | \n", "0.0 | \n", "0.0 | \n", "1036.0 | \n", "NaN | \n", "NaN | \n", "