 Welcome back at the open course on programming for geospatial hydrological applications. I'm Hans van der Kluest, your lecturer. We're starting module 3, map algebra, with an introduction to Python libraries. Sometimes we need more than is available in the standard Python, and therefore we need libraries, and libraries are a collection of functions and methods that add functionality, and you can import a library into your own scripts using the import word and then the name of the libraries. In this case, in this example, you see OS, which is a library for using operating system functions, and GLOP is a library for searching for string patterns. Let's first have a look at some terminology which can be confusing. A module contains Python definitions and statements, but is stored in one file with a .py extension. A package is a way of structuring these modules by using the dotted module names, so you can think of packages as the directories on a file system and modules as files within those directories, and then we use a dot to separate them. Then we have scripts, that's basically a bunch of code lines that you execute, and then we can also call it a program or an application. And then there's a library which is a more generic term of a bunch of code that's designed of being usable and reused by many applications. When we publish a module, a package or something else, then we refer to it as a library. And often these libraries contain a package or multiple related packages, but it could also be even a single module. So where can I find these libraries? The libraries, they come with distributions, and distributions have their own way to install these new libraries. For example, in Anaconda that we will use in this course, you use the command konda install and then the name of the library, in this case scipy. You can find an overview of many of these libraries in the Python package index. It's a repository of software for the Python programming language, and it contains many projects. Let's first have a look at some libraries that we often use in our field. There's the NumPy library, which we use very much in data science. It is for dealing with numerical arrays, to do calculations with matrices and apply mathematical operations to them. Because it's very comparable with the MATLAB way of using arrays, it is very easy for MATLAB users to switch to Python and use NumPy. Another useful library in data science is Pandas. It brings NumPy to another level, which you can use for all kinds of advanced data analysis. Often we also want to plot our data, then the matplotlib library is very useful. As the name says, it's very much related to the MATLAB syntax for plotting. So also here, MATLAB users can easily switch to Python and use matplotlib to get the same nice visualizations. Including the interactive windows, where you can also save the files, you can use LaTeX for styling, and it's very well documented. You can find lots of examples in the gallery. We already mentioned GDAL before. It is accessible through the OSGO library. So we can use the GDAL module from the OSGO package, and here you see how that works to convert, again, the GeoTips to PCRuster format using GDAL Translate. If you want to learn more about NumPy, Pandas, and matplotlib, I can highly recommend to look at the Python data science handbook from Jake Thunderplus. If you want more focus on hydrology, you can have a look at HydroPy by Steinfun Hui. In this module, we will focus more on the use of GDAL and the PCRuster Python library for MapAlgebra.