Loops in Python Exercise
Loops can be used to automate data tasks in Python by iteratively executing the same code on multiple data structures. Practice using loops to automate certain functionality in Python.
last updated: 03 Sep 2020
Loops can be used to automate data tasks in Python by iteratively executing the same code on multiple data structures. Practice using loops to automate certain functionality in Python.
last updated: 03 Sep 2020
A list comprehensions in Python is a type of loop that is often faster than traditional loops. Learn how to create list comprehensions to automate data tasks in Python.
last updated: 28 Jan 2021
MODIS is a satellite remote sensing instrument that collects data daily across the globe at 250-500 m resolution. Learn how to import, clean up and plot MODIS data in Python.
last updated: 19 Nov 2021
A set of activities for you to practice your skills using Landsat Data in Open Source Python.
last updated: 27 Jan 2022
Most remote sensing data sets contain no data values that represent pixels that contain invalid data. Learn how to handle no data values in Python for better raster processing.
last updated: 27 Jan 2022
Landsat remote sensing data often has pixels that are covered by clouds and cloud shadows. Learn how to remove cloud covered landsat pixels using open source Python.
last updated: 27 Jan 2022
Learn how to open up and create a stack of Landsat images and crop them to a certain extent using open source Python.
last updated: 27 Jan 2022
Landsat 8 data are downloaded in tif file format. Learn how to open and manipulate Landsat 8 data in Python. Also learn how to create RGB and color infrared Landsat image composites.
last updated: 11 Jun 2021
An activity to practice all of the skills you just learned in .
last updated: 11 Sep 2020
When you plot time series data using the matplotlib package in Python, you often want to customize the date format that is presented on the plot. Learn how to customize the date format on time series plots created using matplotlib.
last updated: 11 Sep 2020
Sometimes you need to take time series data collected at a higher resolution (for instance many times a day) and summarize it to a daily, weekly or even monthly value. This process is called resampling in Python and can be done using pandas dataframes. Learn how to resample time series data in Python with Pandas.
last updated: 11 Sep 2020
Sometimes you have data over a longer time span than you need for your analysis or plot. Learn how to subset your data using a begin and end date in Python.
last updated: 11 Sep 2020
Python provides a datetime object for storing and working with dates. Learn how you can convert columns in a pandas dataframe containing dates and times as strings into datetime objects for more efficient analysis and plotting.
last updated: 11 Sep 2020
Python provides a datetime object for storing and working with dates. Learn how you can convert columns in a pandas dataframe containing dates and times as strings into datetime objects for more efficient analysis and plotting.
last updated: 19 Jan 2022
Learn how to create a cumulative sum plot in Pandas to better understand stream discharge in a watershed
last updated: 11 Sep 2020
Learn how to calculate exceedance probability and return periods associated with a flood in Python.
last updated: 11 Sep 2020
A function is a reusable block of code that performs a specific task. Learn how to write functions that can take multiple as well as optional parameters in Python to eliminate repetition and improve efficiency in your code.
last updated: 28 Jan 2021
A function is a reusable block of code that performs a specific task. Learn how to write functions in Python to eliminate repetition and improve efficiency in your code.
last updated: 03 Sep 2020
A function is a reusable block of code that performs a specific task. Learn how functions can be used to write efficient and DRY (Do Not Repeat Yourself), code in Python.
last updated: 28 Jan 2021
Loops can be an important part of creating a data workflow in Python. Use loops to go from raw data to a finished project more effeciently.
last updated: 28 Jan 2021
Loops can be used to automate data tasks in Python by iteratively executing the same code on multiple data structures. Learn how to automate data tasks in Python using data structures such as lists, numpy arrays, and pandas dataframes.
last updated: 03 Sep 2020
Loops can help reduce repetition in code by iteratively executing the same code on a range or list of values. Learn about the basic types of loops in Python and how they can be used to write Do Not Repeat Yourself, or DRY, code in Python.
last updated: 28 Jan 2021
Conditional statements in Python can be written to check for alternative conditions or combinations of multiple conditions. Learn how to write conditional statements in Python that choose betweeen alternative conditions or check for combinations of conditions before executing code.
last updated: 28 Jan 2021
Conditional statements help you to control the flow of code by executing code only when certain conditions are met. Learn about the structure of conditional statements in Python and how they can be used to write Do Not Repeat Yourself, or DRY, code in Python.
last updated: 03 Sep 2020
Pandas dataframes are a commonly used scientific data structure in Python that store tabular data using rows and columns with headers. Learn how to use indexing and filtering to select data from pandas dataframes.
last updated: 12 Nov 2020
Pandas dataframes are a commonly used scientific data structure in Python that store tabular data using rows and columns with headers. Learn how to run calculations and summary statistics (such as mean or maximum) on columns in pandas dataframes.
last updated: 15 Sep 2020
Pandas dataframes are a commonly used scientific data structure in Python that store tabular data using rows and columns with headers. Learn how to import text data from .csv files into numpy arrays.
last updated: 15 Sep 2020
Pandas dataframes are a commonly used scientific data structure in Python that store tabular data using rows and columns with headers. Learn about the key characteristics of pandas dataframes that make them a useful data structure for storing and working with labeled scientific datasets.
last updated: 15 Sep 2020
Numpy arrays are an efficient data structure for working with scientific data in Python. Learn how to use indexing to slice (or select) data from one-dimensional and two-dimensional numpy arrays.
last updated: 28 Jan 2021
Numpy arrays are an efficient data structure for working with scientific data in Python. Learn how to run calculations and summary statistics (such as mean or maximum) on one-dimensional and two-dimensional numpy arrays.
last updated: 15 Sep 2020
Numpy arrays are an efficient data structure for working with scientific data in Python. Learn how to import text data from .txt and .csv files into numpy arrays.
last updated: 28 Jan 2021
Numpy arrays are a commonly used scientific data structure in Python that store data as a grid, or a matrix. Learn about the key characteristics of numpy arrays that make them an efficient data structure for storing and working with large scientific datasets.
last updated: 15 Sep 2020
The os and glob packages are very useful tools in Python for accessing files and directories and for creating lists of paths to files and directories, respectively. Learn how to manipulate and parse file and directory paths using os and glob.
last updated: 12 Nov 2020
Manually constructed files paths will often not run on computers with different operating systems. Learn how to construct file paths in Python that will work on Mac, Linux and Windows, in support of open reproducible science.
last updated: 23 Sep 2020
A directory refers to a folder on a computer that has relationships to other folders. Learn about directories, files, and paths, as they relate to creating reproducible science projects.
last updated: 23 Sep 2020
Packages in Python provide pre-built functionality that adds to the functionality available in base Python. Learn how to install packages in Python using conda environments.
last updated: 23 Sep 2020
A conda environment is a self contained Python environment that allows you to run different versions of Python (with different installed packages) on your computer. Learn how to conda environments can you help manage Python packages and dependencies.
last updated: 16 Sep 2020
The Python programming language provides many packages and libraries for working with scientific data. Learn about key Python packages for earth data science.
last updated: 28 Jan 2021
When you plot time series data in matplotlib, you often want to customize the date format that is presented on the plot. Learn how to customize the date format in a Python matplotlib plot.
last updated: 24 Sep 2020
Matplotlib is the most commonly used plotting library in Python. Learn how to customize the colors, symbols, and labels on your plots using matplotlib.
last updated: 16 Sep 2020
Matplotlib is the most commonly used plotting library in Python. Learn how to create plots using the matplotlib object oriented approach.
last updated: 02 Sep 2020
DRY (Do Not Repeat Yourself) code supports reproducibility by removing repetition and making code easier to read. Learn about key strategies to write DRY code in Python.
last updated: 16 Sep 2020
Expressive variable names refer to function and variable names that describe what the variable contains or what the function does. Using expressive names makes your code easier to understand. Learn how to create expressive names for objects in your Python code.
last updated: 16 Sep 2020
Using a standard format and syntax when programming makes your code easier to read. Learn more about PEP 8, a set of guidelines for writing clean code in Python.
last updated: 23 Sep 2020
Clean code refers to writing code that runs efficiently, is not redundant and is easy for anyone to understand. Learn about the characteristics and benefits of writing clean, expressive code in Python.
last updated: 03 Sep 2020
Complete these exercises to practice the skills you learned in the Python fundamentals chapters.
last updated: 23 Sep 2020
Operators are symbols in Python that carry out a specific computation, or operation, such as arithmetic calculations. Learn how to use basic operators in Python.
last updated: 23 Sep 2020
A Python list is a data structure that stores a collection of values in a specified order (or sequence) and is mutable (or changeable). Learn how to create and work with lists in Python.
last updated: 23 Sep 2020
Variables store data (i.e. information) that you want to re-use in your code (e.g. single numeric value, path to a directory or file). Learn how to to create and work with variables in Python.
last updated: 23 Sep 2020
Python is a free, open source programming language that can be used to work with scientific data. Learn about using Python to develop scientific workflows.
last updated: 23 Sep 2020
Open reproducible science refers to developing workflows that others can easily understand and use. Learn about best practices for organizing open reproducible science projects including the use of machine readable names.
last updated: 14 Sep 2020
Key tools for open reproducible science include Shell (Bash), git and GitHub, Jupyter, and Python. Learn how these tools help you implement open reproducible science workflows.
last updated: 14 Sep 2020
Open reproducible science refers to developing workflows that others can easily understand and use. It enables you to build on others' work rather than starting from scratch. Learn about the importance and benefits of open reproducible science.
last updated: 03 Sep 2020
Designing and developing data workflows can help you complete your work more efficiently by allowing you to repeat and automate data tasks. Learn how to design and develop efficient workflows to automate data analyses in Python.
last updated: 11 Sep 2020
Pseudcode can help you design data workflows through listing out the individual steps of workflow in plain language, so the focus is on the overall data process, rather than on the specific code needed. Learn best practices for writing pseudocode for data workflows.
last updated: 11 Sep 2020
Identifying aspects of a workflow that can be modularized and tested can help you design efficient and effective data workflows. Learn best practices for designing efficient data workflows.
last updated: 11 Sep 2020
Restructured text (RST) is a text format similar to markdown that is often used to document python software. Learn how create headings, lists and code blocks in a text file using RST syntax.
last updated: 01 Apr 2020
Lack of documentation will limit peoples’ use of your code. In this lesson you will learn about 2 ways to document python code using docstrings and online documentation. YOu will also learn how to improve documentation in other software packages.
last updated: 01 Apr 2020
Open source means that you can view and contribute to software code like packages you use in Python. Learn about the ways that you can contribute without being an expert progammer.
last updated: 01 Apr 2020
Open source means that you can view and contribute to software code like packages you use in Python. Learn about the ways that you can contribute without being an expert progammer.
last updated: 01 Apr 2020
This activity provides an opportunity to practice writing DRY code using loops, conditional statements, and functions.
last updated: 08 Dec 2020
This lesson covers how to crop a raster dataset and export it as a new raster in Python
last updated: 04 Sep 2019
Sometimes you need to manipulate multiple rasters to create a new raster output data set in Python. Learn how to create a CHM by subtracting an elevation raster dataset from a surface model dataset in Python.
last updated: 04 Sep 2019
This lesson introduces the raster geotiff file format - which is often used to store lidar raster data. You will learn the 3 key spatial attributes of a raster dataset including Coordinate reference system, spatial extent and resolution.
last updated: 04 Sep 2019
Text editors can be used to edit code and for commit messages in git. Learn about features to look for in a text editor and how to change your default text editor at the command line.
last updated: 21 Jan 2022
Conda environments allow you to easily manage the Python package installations on your computer. Learn how to install a conda environment using a yml file.
last updated: 15 Jan 2020
This tutorial walks you through how access the shell through terminal, use basic commands in the terminal for file organization, and set up a working directory for the course.
last updated: 03 Sep 2019
Learn how to install Git, GitBash (a version of command line Bash) and the Miniconda Python distribution on your computer.
last updated: 03 Sep 2019
In this lesson you will review how to find and download USDS NAIP imagery from the USGS Earth Explorere website.
last updated: 28 Jan 2021
Multispectral remote sensing data can be in different resolutions and formats and often has different bands. Learn about the differences between NAIP, Landsat and MODIS remote sensing data as it is used in Python.
last updated: 28 Jan 2021
Sometimes you will work with multiple rasters that are not in the same projections, and thus, need to reproject the rasters, so they are in the same coordinate reference system. Learn how to reproject raster data in Python using Rasterio.
last updated: 09 Nov 2020
Sometimes a raster dataset covers a larger spatial extent than is needed for a particular purpose. In these cases, you can crop a raster file to a smaller extent. Learn how to crop raster data using a shapefile and export it as a new raster in open source Python
last updated: 09 Nov 2020
Reclassifying raster data allows you to use a set of defined values to organize pixel values into new bins or categories. Learn how to classify a raster dataset and export it as a new raster in Python.
last updated: 09 Nov 2020
Often you need to process two raster datasets together to create a new raster output and then save that output as a new file. Learn how to subtract rasters and create a new GeoTIFF file using open source Python.
last updated: 09 Nov 2020
You can perform the same raster processing steps in Python that you would in a tool like ArcGIS. Learn how to process spatial raster data using Open Source Python.
last updated: 05 Nov 2020
Raster data are gridded data composed of pixels that store values, such as an image or elevation data file. Learn how to open, plot, and explore raster files in Python using Rasterio.
last updated: 05 Nov 2020
Challenge your skills. Practice opening, cleaning and plotting raster data in Python
last updated: 19 Aug 2021
Metadata describe the key characteristics of a dataset such as a raster. For spatial data, these characteristics including the coordinate reference system (CRS), resolution and spatial extent. Learn about the use of TIF tags or metadata embedded within a GeoTIFF file to explore the metadata programatically.
last updated: 19 Aug 2021
Raster metadata includes the coordinate reference system (CRS), resolution, and spatial extent. Learn about these metadata and how to access them in Python
last updated: 06 Nov 2020
Histograms of raster data provide the distribution of pixel values in the dataset. Learn how to explore and plot the distribution of values within a raster using histograms.
last updated: 06 Nov 2020
Raster data are gridded data composed of pixels that store values, such as an image or elevation data file. Learn how to open, plot, and explore raster files in Python.
last updated: 09 Nov 2020
You often want to understand the relationships between two different types of data. Learn how to use regression to determine whether there is a relationship between two variables.
last updated: 12 Feb 2021
To explore uncertainty in remote sensing data, it is helpful to compare ground-based measurements and data that are collected via airborne instruments or satellites. Learn how to create scatter plots that compare values across two datasets.
last updated: 12 Feb 2021
For many scientific analyses, it is helpful to be able to select raster pixels based on their relationship to a vector dataset (e.g. locations, boundaries). Learn how to extract data from a raster dataset using a vector dataset.
last updated: 02 Feb 2021
Uncertainty quantifies a range of values within which a measurement value could be within, considering a specified level of confidence. Learn about the types of uncertainty that you can expect when working with tree height data both derived from lidar remote sensing and human measurements and learn about sources of error including systematic vs. random error.
last updated: 02 Feb 2021