Week by week

You will find the course announcements and daily activities here.

🌀 Fall 2024 Week by week

Week 0 : Sept 22 - 28

THIS WEEK ONLY: The schedule and rooms remain the same, but Annie will lead the Thursday setup session, and Carmen will lead the full class on Friday. Everyone is expected to attend both.

Assignments (due by the end of Thursday)

  1. Read the course syllabus. You will find it on the landing page for our EDS 220 course website.

  2. Complete the entry survey. This will help the teaching team get to know you and your expectations for the course. The survey is part of your participation grade. https://forms.gle/s6mJ3BcZR6U7a2Q97.



Setup session (Thursday)

  1. Setup of discussion sections repository following the repository setup instructions
  2. Python assessment. This is not graded and completion counts towards participation grade.



Class 1 (Friday)

  1. Course introduction slides
  2. Set up of GitHub repository for in-class coding sessions.
  3. Covered Python review up to “Objects” section.
  1. Create a new repository on GitHub. Use the following settings:

    • Repository name: eds220-2025-in-class.

    • Description: In-class work for the EDS 220 MEDS course.

    • Visibility: Keep the repository public.

    • Don’t select any template to start.

    • Add a README file.

    • Add a Python .gitignore template.

    • Add the MIT License.

  2. In GitHub, update your repository’s README by:

    1. Deleting all the text that was automatically generated when you created the repo.
    2. Copy-pasting the markdown text below and update [YOUR NAME HERE]. Commit your changes.
# EDS 220 In-Class Repository

This repository hosts all the work completed by [YOUR NAME HERE] during the EDS 220 - *Working with Environmental Data* lectures.

## Course Information

- **Course Title:** [EDS 220 - Working with Environmental Datasets](https://bren.ucsb.edu/courses/eds-220)
- **Term:** Fall 2025
- **Program:** [UCSB Masters in Environmental Data Science](https://bren.ucsb.edu/masters-programs/master-environmental-data-science).

Teaching Team:

- **Instructor:** [Carmen Galaz García](https://github.com/carmengg)
- **Co-Instructor:** [Annie Adams](https://github.com/annieradams) 

Complete materials for the discussion sections and additional resources can be found on the [course website](https://meds-eds-220.github.io/MEDS-eds-220-course/).
  1. Add the URL to your GitHub repository to this spreadhseet.

  2. Clone your new repository into your MEDS/EDS-220 directory in workbench-1.

Preparation for Tuesday class (September 30)
  1. In your EDS-220/eds220-2025-in-class directory, create a new Python notebook called week1-pandas-series.ipynb.
  2. Read the notes chapter on pandas series data frames and follow along with the code.
  3. Read the best practices to write comments in the notes.
  4. Solve the check-in exercises. We’ll present these during class.
  5. Make a summary of the lesson. What are the most important concepts or ideas?

Week 1 : Sept 29 - Oct 5

Class 2 (Tuesday)

  1. Finished Python review.
  2. Student presentations of pandas.Series and pandas.DataFrames exercises.

To store your personal access token (PAT) in the server:

1. Have a PAT ready

If you already have a PAT that you can copy paste, you can skip to step 2. Otherwise, create or regenerate one. You can follow the instructions in the MEDS installation guide or create or regernerate one directly through GitHub.

2. Set up the git credential helper

  1. Using the terminal, navigate to the directory from where you want to push your updates. Make sure you are on that directroy (for example, verify you are on the eds-2025-in-class by running pwd on the terminal).

  2. Run the following command on the terminal:

git config --global credential.helper store

This indicates to git that you want to store the PAT instead of caching it.

  1. Run git config --global --list on the terminal. You should see something like this as the output:
user.name=carmengg
user.email=c_galazgarcia@ucsb.edu
credential.helper=store

That last line indicates that the credential helper is now store.

3. Complete a push

Go through the steps to make a push. Git will prompt you for your credentials, use your GitHub username and use the PAT as the password. Press enter and finalize the push!

4. Verify credentials

  1. Go to your user’s home directory by running cd ~.

  2. Run more .git-credentials. You should see something like this as the output:

https://carmengg:ghp_XTWwWrEtGfL45iIgU6PPDFd990ceIYydqY@github.com

This means your PAT is now stored (the PAT here is an example).

Git should have now stored your PAT on the server!

Preparation for Thursday class (October 2)
  1. Create a directory called data within your eds220-2025-in-class repository.
  2. Download the CSV file wetlands_seasonal_bird_diversity.csv from our shared drive.
  3. Do not push this file to GitHub.



Class 3 (Thursday)

  1. Completed activity (see below) to add the data directory to the .gitignore file of the EDS-220/in-class-notebooks/ directory.
  2. Covered pandas subsetting notes up to…

Setup:

  1. Download the CSV file wetlands_seasonal_bird_diversity.csv from our shared drive.

  2. In the workbench 1 server, inside your EDS-220/in-class-notebooks/ directory, create a new directory called data.

  3. Using the file navigation panel, upload the wetlands_seasonal_bird_diversity.csv file to the data directory.

In the terminal:

  1. Verify you are in the in-class-notebooks/ directory by using pwd. Your output should look like this:
/Users/your-username/MEDS/EDS-220/in-class-notebooks
  1. Run git status. At the end of the output you’ll see:
Untracked files:
  (use "git add <file>..." to include in what will be committed)
        data/

This means git has detected that the data directory exists but it is not yet tracking changes in it. We are in charge of deciding whether we want to track changes in it or not!

  1. Run ls to see the files in the directory. Your output will look like this, notice the .gitiginore file is not listed:
README.md  week1-lesson1-python-review.ipynb
data       week1-lesson3-pandas-subsetting.ipynb
  1. Run ls -a to see all files in the directory, including hidden files (those that start with a period .). At this point, your output will look like this:
.                   README.md
..                  data
.git                week1-lesson1-python-review.ipynb
.gitignore          week1-lesson3-pandas-subsetting.ipynb
.ipynb_checkpoints
  1. Run nano .gitignore. This will open the .gitignore file in the nano editor.

  2. Add the data folder to the .gitignore file by adding this text at the top of the file:

# Ignore the 'data' directory
data/
  1. Once you have made your changes, save the file:
  • In nano, press CTRL + O (the letter O, not zero) to save.
  • Press Enter to confirm the file name (.gitignore).
  1. Exit the editor by pressing CTRL + X.

  2. Run less .gitignore to scroll through the .gitignore file and verify the changes are there:

  • Use the arrow keys or Page Up/Page Down to scroll through the file.
  • Press q to exit.
  1. Run git status and check the output. The data directroy will no longer be listed! You will see your .gitgnore having changes ready for commit.

  2. Commit and push your changes to the .gitignore.

Preparation for Tuesday class (October 7)
  1. In your EDS-220/eds220-2025-in-class directory, create a new Python notebook called week2-basic-plotting.ipynb.
  2. Read the notes on basic plotting and follow along with the code.
  3. Solve the check-in exercises. We’ll present these during class.
  4. Make a summary of the lesson. What are the most important concepts or ideas?



Discussion section (Friday)

There’s no setup for this week’s discussion section.

Week 2 : Oct 6 - Oct 12

Class 4 (Tuesday)

  1. Finished pandas subsetting notes.
  2. Student presentations of basic plotting exercises.
Preparation for next class

Task 1

  1. In your EDS-220/eds220-in-class directory, create a new Python notebook called week2-updating-dataframes.ipynb.
  2. Read the notes on updating dataframes up to the end of the “Removing columns” section and follow along with the code.
  3. We will cover the “Updating values” section during class. The class will start assuming you have all the data loaded.

Task 2

  1. In your EDS-220/eds220-in-class directory, create a new Python notebook called week2-groupby.ipynb.
  2. Read the notes on grouping and follow along with the code.
  3. Summarize the lesson and solve the check-in exercise. We’ll present it during class.



Class 5 (Thursday)

  1. Short review of updating dataframes notes up to “Updating values” section.
  2. Covered “Updating values” section of the updating dataframes notes.
  3. Student discussion of grouping notes and presented solutions for check-in.
Preparation for next class
  1. Install VS Code on your local computer. MEDS installation guide



Discussion section

Preparation for discussion section
  • Complete steps 1, 2, and 3 of the second discussion section to load the data before the discussion section.

  • You’ll be working on exercises 4-9 during section, so it is important that you have the data ready to go tomorrow.

  • Check-in with your discussion section teams via Slack to make sure you’re all ready to go on Friday!

Week 3 : Oct 13 - Oct 19

Class 6 (Tuesday)

  1. Covered conda environments notes on the workbench and slides.
  2. Set up VSCode to work on personal computers, without the course conda environment.
  1. Create a MEDS/EDS-220 directory in your personal computer.

  2. Open VSCode.

  3. Add a new bash terminal in it.

  4. Confirm git installation by running git version in the terminal. If git is installed you will get something similar to

git version 2.33.1
  1. If you don’t get a similar output, install git by following the MEDS installation guide.

  2. Clone your eds-220-in-class repository inside the MEDS/EDS-220 directory. You can do this using the terminal or using the VSCode interface:

  1. Confirm your conda installation by running conda info in the terminal. If conda is active you will get something similar to
active environment : base
active env location : /Users/galaz-garcia/opt/anaconda3
shell level : 1

[...]

UID:GID : 502:20
netrc file : None
offline mode : False
  1. If conda needs to be added to the shell profile, follow the troubleshooting steps in the MEDS installation guide within a bash terminal (not Powershell if you are on Windows).

  2. Install Python extension to VSCode:



Class 7 (Thursday)

  1. Built conda environment for the course on personal computers.
  2. Covered time series notes @ workbench.
  3. Reviewed git workflow with personal computer and workbench.

Make sure you have completed the VSCode set-up before creating the environment.

  1. Open VSCode on your computer.

  2. Download the following YAML file and move it into your eds220-in-class directory: https://github.com/MEDS-eds-220/MEDS-eds-220-course/blob/main/eds220-env.yml

  3. Open a bash terminal inside VSCode and in it:

  1. Verify you are in the eds220-in-class directory.
  2. Verify that the eds220-env.yml file is in the directory.
  3. Run the following conda command to build the environment used for the course:
conda env create --name eds220-env --file eds220-env.yml

It will take about 15 minutes to build the environment. Once conda has finished, verify that the environment was created by running conda env list.

Make sure you have built the eds220-env before creating the kernel.

  1. Open VSCode on your computer.

  2. Add a new bash terminal in it.

  3. Verify you have the eds220-env conda environment available by running

conda env list
  1. Activate the eds220-env by running
conda activate eds220-env
  1. Verify the environment has been activated.

  2. Run

python -m ipykernel install --user --name eds220-env --display-name "EDS-220 env"
  1. Verify that the kernel has been created by running
jupyter kernelspec list

The output should look similar to this:

Available kernels:
  eds220-env        /Users/galaz-garcia/Library/Jupyter/kernels/eds220-env
  python3           /Users/galaz-garcia/opt/anaconda3/share/jupyter/kernels/python3
  1. Close and reopen VSCode.

  2. To use the new kernel, open a Jupyter notebook on VSCode and…

Preparation for next class

Read the notes on coordinate reference systems and vector data formats. Most of it should be review from EDS 223. We will have some questions to test your understanding of key concepts at the start of the next class.



Discussion section (Friday)

Preparation for discussion section
  • Complete steps 1 of the third discussion section. There’s no data to be loaded.

  • You’ll be working on exercises 2-8 during section, so come prepared with some prior knowledge of this dataset..

  • Check-in with your discussion section teams via Slack to make sure you’re all ready to go on Friday!

Week 4 : Oct 20 - Oct 26

Class 8 (Tuesday)

  1. Went over git merge conflict slides.
  2. Installed Quarto following MEDS installation guide and installed the VSCode Quarto extension.
  3. Completed activites 1 and 2 to practice git merge conflicts.
Preparation for next class
  1. In the eds220-in-class repository in your personal computer, create a directory called data.
  2. Confirm the data folder is not being tracked by git.
  3. Download the directories file ca_state_boundary and gbif_sus_scrofa_california from our shared drive. You should have the follwing file structure:
data
  ├── ca_state_boundary
     ├── all the shapefile files
  └── gbif_sus_scrofa_california
      ├── all the shapefile files



Class 9 (Thursday)

  1. Coordinate reference systems and vector data types review and quiz!
  2. Covered the geopandas notes up to plotting the first preliminary map (without matplotlib).
Preparation for next class

The following steps take place in your personal computer.

  1. Follow the steps in the About the data section of the Streamline your code notes to download the 2022 TIGER shapefiles of the US states.
  2. Place the tl_2022_us_state folder containing the shapefile files in your EDS-220/eds220-in-class/data directory.
  3. In your EDS-220/eds220-in-class directory, create a new Python notebook called week5-code-streamlining.ipynb.
  4. Add the following three cells to your notebook. Make sure you have the data loaded before class! 🙌

Cell 1:

import os

import pandas as pd
import geopandas as gpd

Cell 2:

# Import power plants data
URL = 'https://raw.githubusercontent.com/carmengg/eds-220-book/refs/heads/main/data/power_plants_epsg4269.csv'
power_plants = pd.read_csv(URL)
power_plants.head()

Cell 3:

# Import states data
fp = os.path.join('data','tl_2022_us_state','tl_2022_us_state.shp')
states = gpd.read_file(fp)
states.head()



Discussion Section (Friday)

There’s no setup for this week’s discussion section.

Week 5 : Oct 27 - Nov 2

Class 9 (Tuesday)

  1. Finished geopandas notes.
  2. Covered notes on streamlining your code up to (including) assert.

Class 10 (Thursday)

  1. Finished notes on streamlining your code.
Preparation for next class

The following steps take place in your personal computer.

  1. Read the About the data section in the Reprojecting notes.
  2. Download the Admin O - Countries and add it to the data folder for you eds-220-in-class directory.
  3. In your EDS-220/eds220-in-class directory, create a new Python notebook called week6-reprojecting.ipynb
  4. Add the following three cells to your notebook. Make sure you have the data loaded before class! 🙌

Cell 1:

import os
import pandas as pd
import matplotlib.pyplot as plt
import geopandas as gpd

Cell 2:

# Import countries shapefile
fp = os.path.join('data','ne_50m_admin_0_countries','ne_50m_admin_0_countries.shp')
countries = gpd.read_file(fp)
countries.columns = countries.columns.str.lower()  # Simplify column names
countries = countries[['admin', 'type', 'geometry']]
countries.head(3)

Cell 3:

# Import Arctic communities GeoJSON directly from URL
URL = 'https://cn.dataone.org/cn/v2/resolve/urn%3Auuid%3Aed7718ae-fb0d-43dd-9270-fbfe80bfc7a4'
communities = gpd.read_file(URL)
communities.head()

Cell 3:

# Import country names from URL
URL = 'https://raw.githubusercontent.com/MEDS-eds-220/MEDS-eds-220-course/refs/heads/main/book/chapters/lesson-12-merge-data/country_names.csv'
country_names = pd.read_csv(URL)
country_names.head()

Discussion section (Friday)

No work to do ahead of the discussion section.

Week 6 : Nov 3 - Nov 9

Class 11 (Tuesday)

  • Covered functions and exercises

Exercise 1

Create a function called power_source_counts that, given a power source, returns a Series with the counts of power plants by state that use that source.

Follow the steps:

  1. solve the problem for a specific example (e.g., ‘wind’)
  2. identify which parts of the code need to be generalized and update these parts
  3. wrap this into a function
  4. add additional parameters or assert statements if needed

Exercise 2

  1. Recreate the following plot.
  2. Make a function that produces this plot for any power source.
  3. Brainstorm ways in which your function might break or not produced the desired output.

Bonus Create a function that, for a given power source, produces a plot like this one. Many ways of doing it, a hint could be to zip three things together: the axes, the top 3 states, and the counts of power plants in those states.

# Example of more than two zipped items

for a, b, c in zip([1,2,3], ['x','y','z'], [10,20,30]):
    print(a, b, c)

Class 12 (Thursday)

Preparation for next class
  1. Read the About the data section in the clipping notes.
  2. Download the Natural Earth’s populated places (simple, less columns) dataset and add it to the data folder for you eds-220-in-class directory.
  3. Download the Natural Earth’s roads dataset and add it to the data folder for you eds-220-in-class directory.
  4. Download the notebook week7-clipping-STUDENTS.ipynb, rename it to week7-clipping.ipynb, and move it into your EDS-220/eds220-in-class directory.
  5. Edit the notebook if needed to load the three datasets (the third is already in your computer). Make sure you have all the data loaded before class! 🙌

Discussion section

We’ll be using a fairly big dataset so we’ll work on the workbench where this data has already been stored.

You can work directly on the workbench or you can practice using VSCode to SSH into workbench-1.

If you decide to SSH into workbench-1, practice before discussion section and make sure you can run a notebook (any) from your in-class directory.

Week 7 : Nov 10 - Nov 16

There’s no class on Tuesday, November 11

It’s Veteran’s day. Enjoy the long weekend!

Class 13 (Thursday)

We started from a pre-filled notebook week7-clipping-STUDENTS.ipynb that students downloaded before class.

Preparation for next class

Download the notebook week8-xarray-STUDENTS.ipynb, rename it to week8-xarray.ipynb, and move it into your EDS-220/eds220-in-class directory.

There’s nothing to run in this notebook. We’ll just use it to have some pre-filled code.


Discussion Section (Friday)

  1. Download the notebook week7-refactoring.ipynb from the course’s Google Drive and move it inside your eds-220-sections directory.

  2. Download the zip file WDPA_Nov2025_Latam.zipfrom the course’s Google Drive, unzip it, and add it to the data directory in your eds-220-sections directory.

  3. Run the week7-refactoring.ipynb notebook to make sure you can access the data.

Week 8: Nov 17 - Nov 23

Class 14 (Tuesday)

We started from a pre-filled notebook week8-xarray-STUDENTS.ipynb.

Preparation for next class
  1. Download the following datasets from the course’s Google Drive and add them to the data directory in your eds-220-sections directory:
  • NAIP_SB/NAIP_SB_nir.tif
  • NAIP_SB/NAIP_SB_rgb.tif
  • SB_aoi.geojson
  1. Download the notebook week8-rioxarray-STUDENTS.ipynb, rename it to week8-rioxarray.ipynb, and move it into your EDS-220/eds220-in-class directory.

  2. Update the file path in the code cell so it points to your data folder containing the rasters and the geoJSON file. There’s nothing to run in this notebook. We’ll just use it to have some pre-filled explanations.



Class 15 (Thursday)

We started from a pre-filled notebook week8-rioxarray-STUDENTS.ipynb.

Preparation for next class

Download the notebook week9-STAC-STUDENTS.ipynb, rename it to week9-STAC.ipynb, and move it into your EDS-220/eds220-in-class directory. There’s nothing to run in this notebook. We’ll just use it to have some pre-filled code.



Discussion section (Friday)

  1. Find fire perimeters for the Eaton and Palisades fires that occurred in LA County on 2025. There are several datasets with this information online. You will need to independently select one from a reputable source (it may be more than one file). These are the same files you will use for assignment 4.

  2. Download the 2024 Environmental Justice Index data for California in the geodatabase data format. Add it to the data directory in your eds-220-sections directory.