Open Course · 10 Modules · 17 Colab Notebooks

Fundamentals of Python for H&H Modeling and Analysis

A practical Python course for water resources engineers who want usable scripting skills for hydrologic and hydraulic modeling without turning into software engineers. Learn with real USGS streamflow, spatial vector and raster layers, Atlas 14 design storms, soils, NLCD, NAIP imagery, and snowpack grids directly in Google Colab.

Zero setup in Google Colab 100% public USGS, NOAA, NRCS & NSIDC datasets Personal educational use free forever
watershed_hydrograph.py Click sky for rain or adjust CN

        

What Makes This Course Different

Designed for practicing engineers who already understand runoff, gauges, and watersheds and want clear code that fits daily engineering work.

Real-World Focus

Every lesson works through daily H&H tasks (time series, vector watersheds, DEMs, USGS stream gauges, precipitation frequency storms, soils, land cover, imagery, and snowpack volume) with real public datasets.

Clarity Over Complexity

The emphasis stays on readable, commented code that replaces repetitive spreadsheet steps, documents engineering assumptions, and creates reproducible tables and figures.

AI-Assisted Learning

AI assistants have changed how engineers write and debug scripts. Each module includes practical prompts that help you inspect unfamiliar libraries, spot unit or projection mistakes, and adapt code with engineering judgment.

Course Modules

Select a learning track, filter by level or keyword, and open any notebook straight into Google Colab. Check off lessons as you finish them to track progress in this browser.

0 / 17 lessons completed

From Spreadsheets and GIS Clicks to Readable Python

Inspect four real patterns taught across the course and compare manual workflows against short, repeatable Python scripts.

Getting Started

Everything runs online in a free Google Colab account, or locally if you prefer cloning the GitHub repository.

  1. 1Download or open online. Launch any notebook directly in Google Colab from the course table above or clone the repository for local work.
  2. 2Set up your workspace. Walk through Module 1 to connect spreadsheet mental models to variables, loops, and functions.
  3. 3Work sequentially. Run code cells from top to bottom, verify every QA/QC printout, and try the practice debugging exercises.

A Note on Units

Many examples use U.S. customary units alongside SI units (such as cfs alongside cms, or inches alongside millimeters) to match USGS and NOAA agency conventions. Practice converting between systems as you work through the notebooks.

Level Expectations
Beginner No prior Python experience needed. Concepts are explained from scratch with H&H analogies.
Intermediate Assumes comfort with Python basics (variables, loops, functions, pandas). Focuses on applied workflows.
Advanced Assumes working knowledge of Python and H&H modeling tools for large mosaics or model classification.
Getting Started with Python for H&H video walkthrough thumbnail
Getting Started Video Walkthrough A short tour showing how to navigate this repository, open notebooks in Google Colab, and follow the module structure.

More H&H Python Tools to Explore

Once you are comfortable with the core workflows in Modules 1 to 10, explore these actively maintained open-source libraries used across hydrology and hydraulics.

What Participants Are Saying

Feedback from water resources engineers and learners who completed early course modules.

Participants have also suggested upcoming topics including running Python inside QGIS, HDF5 workflows, and reusable pipeline templates for probabilistic and simulation-based modeling.

HydroMohsen Python for H&H icon

Mohsen Tahmasebi Nasab, PhD

Water Resources Engineer

How This Course Was Reviewed and How You Can Report Issues

This course has been assembled and reviewed manually with AI-assisted coding tools helping check explanations, formatting consistency, and edge cases. Every lesson is reviewed by the author before publication.

Because Python geospatial libraries update over time, a cell that runs cleanly today may need an adjustment later. If you encounter an issue or outdated server URL, please open an issue on GitHub.

Contributing a New Module or Lesson

Submission Steps

  1. Open a GitHub issue proposing your topic before writing full code.
  2. Fork mohsennasab/python-fundamentals-hh and build your lesson on a feature branch.
  3. Include Lesson Level, Purpose, Learning Objectives, Prerequisites, and 2 to 3 practical AI prompts at the top of the notebook.
  4. Verify the notebook runs cleanly end-to-end in a fresh Google Colab session and submit a pull request.

Content Standards

  • Ground examples in real H&H engineering tasks (flood mapping, frequency curves, hydrographs, soils, snow).
  • Write clear, readable Python with helpful comments where beginners could get stuck.
  • Include only public or anonymized sample datasets placed inside a module data/ folder.
Data Sharing Guidelines for Public Repositories

Every dataset committed to the course repository must be safe for open educational distribution.

Acceptable Sources

  • Public agency datasets (USGS, NOAA, USDA/NRCS, NSIDC, state DNRs, EPA).
  • Synthetic or randomized teaching datasets and anonymized watershed excerpts.

Before Committing New Data

  1. Confirm no client, employer, or proprietary project files are traceable inside code, attributes, or metadata tags.
  2. Verify that no credentials, API keys, tokens, or internal server paths remain printed inside notebook outputs.
  3. Verify clearance for public educational release before pushing.
Disclaimer and License (Personal Educational Use)

Disclaimer. This course, including its notebooks, code, datasets, and examples, is provided for educational purposes only without warranty of any kind. Independently verify all inputs, assumptions, calculations, and outputs before applying them to engineering design, modeling, or regulatory submittals.

You May You May Not (Without Written Permission)
Use all materials for personal learning and self-study Redistribute, republish, or mirror the course materials
Contribute pull requests and improvements to the repo Use materials to instruct others, free or paid, online or in person
Link others directly to the repository or course page Sell, monetize, or build derivative training products
License for Personal Educational Use

Copyright (c) 2026 Mohsen Tahmasebi Nasab. All rights reserved.

Permission is hereby granted, free of charge, to any individual obtaining a
copy of these materials and associated documentation files (the "Course
Materials"), to access and use the Course Materials solely for that
individual's own personal, non-commercial learning and self-study, subject to
the following conditions. All rights not expressly granted here are reserved by
the copyright holder.

1. PERSONAL USE ONLY: The Course Materials may be used by individuals for their
   own self-study, personal skill development, and private educational
   purposes. This grant is personal to each user and is not transferable.

2. NO REDISTRIBUTION OR INSTRUCTIONAL USE WITHOUT PERMISSION: The Course
   Materials may not be redistributed, republished, mirrored, or used to
   teach, train, present to, or otherwise instruct any other person or group,
   whether free or paid, online or in person, without prior written permission
   from the copyright holder.

3. NO DERIVATIVE WORKS WITHOUT PERMISSION: Adapted, translated, or derivative
   versions of the Course Materials may not be created for distribution,
   publication, or presentation without prior written permission from the
   copyright holder.

4. NO COMMERCIAL USE: The Course Materials may not be sold, licensed, or used
   as part of any paid training program, commercial product, or for-profit
   service. This includes, without limitation, monetized video content, online
   courses, and ad-supported tutorials that reproduce or are derived from the
   Course Materials.

5. CONTRIBUTIONS: Submitting a contribution (such as a pull request) to this
   repository is permitted and encouraged. By doing so, you grant the copyright
   holder the right to use and publish your contribution as part of the Course
   Materials under these same license terms, with attribution to you as the
   contributor.

6. PERMISSIONS: Requests to teach with, adapt, redistribute, or otherwise use
   the Course Materials beyond personal self-study may be directed to the
   author at https://hydromohsen.com. Any such use requires written permission
   granted in advance, and where granted must credit the original author and
   link to the original repository at
   https://github.com/mohsennasab/python-fundamentals-hh

THE COURSE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES
OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE COURSE MATERIALS OR THE USE OR
OTHER DEALINGS IN THE COURSE MATERIALS.