The revamped Xarray tutorial

Tuesday, June 11th, 2024 (22 days ago)


Over the past several years, we have worked to significantly revamp the Xarray tutorial. The tutorial material is geared towards both new and seasoned practitioners. Consider using it for your own lecture or workshop! Or sign up for the upcoming SciPy 2024 Workshop that we'll be running.


The Xarray Tutorial website hosts a curated selection of Jupyter Notebooks that illustrate concepts, common usage patterns, and long-form examples of using Xarray for data analytics.

We reworked existing material to bite-sized chunks that can be remixed as needed. Rather than organizing material by specific workshops at a top-level, we now organize by topic and then build a learning path for each event. This way future learners can benefit from a guided tour through the material. For example see the Fundamental and Intermediate learning paths that were presented at SciPy 2022 and SciPy 2023 respectively.

We believe this method of organizing material also lends it self to easy reuse for other tutorial/workshop activities that may not want to work through material in the manner the canonical ordering does. Our hope is that this material will serve as a great starting point for anyone anywhere looking to deliver a Xarray tutorial.

Redesigned with Jupyter Book#

We chose to use Jupyter Book as a the tool to render a static HTML version of the tutorial website. We think this has worked well, because it allows you to keep small Jupyter Notebooks in a repository while guaranteeing that code in those notebooks can be executed without errors. It also provides nice linking capabilities directly to the Xarray API documentation. Finally, Jupyter Book simply produces a nice-looking, navigable, and searchable website of all the material. See the before/after image:

Tutorial outline before/after

We've been particularly happy with the jupyterlab-myst extension, which extends the basic Markdown rendering with in JupyterLab and ensures Notebooks rendered as a static webpage look identical to an executable notebook in the JupyterLab interface.

Finally, we think the Xarray Tutorial is a great way to engage new contributors to Open Source Software development. Every Jupyter Book webpage has a GitHub icon dropdown in the upper right hand corner with a 'Open Issue' and 'Suggest Edit' button. This really simplifies the process of community development and we love that during workshops people totally new to the library have made improvements to the content as we run through it. The repository now has over 30 contributors!

New and improved material#

In addition to redesigning the layout, we've improved existing material and added a lot of new material focused on intermediate and advanced concepts:

  1. Revamped fundamentals to include material on indexing, as well as alignment & broadcasting.
  2. All New Intermediate level material:

Try it out#

The Xarray Tutorial is designed for interactivity, with coding exercises and configuration of one-click free hosted computing environments. At past SciPy workshops we've successfully used and GitHub Codespaces to ensure 100+ attendees can run code examples in JupyterLab.

Come contribute#

While a major improvement, this material is clearly a work in progress and could use help from you! Contributions are very welcome and could range from fixing typos, to improving the presentation, and even contributing all new material. We are especially interested in expanding the current use-case content to include more examples with datasets from a broad range of scientific domains. Check out open issues on the repository for ways to contribute! We can also substantially improve the way this tutorial material is linked to in the main Xarray documentation (Github issue).

Come help out!


This work was partially supported by NASA's Open Source Tools, Frameworks, and Libraries (OSTFL) grant 80NSSC22K0345 "Enhancing analysis of NASA data with the open-source Python Xarray Library".

Back to Blog

xarray logo

© 2024, Xarray core developers. Apache 2.0 Licensed.


TwitterGitHubYouTubeBlog RSS Feed
Powered by Vercel