xarray

Manage N-dimensional labeled arrays and datasets in Python with NumPy and Dask.

19|2|Updated Jan 31, 2026
One-click install
npx skills add https://github.com/tondevrel/scientific-agent-skills --skill xarray-tondevrel
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: xarray
Source: https://github.com/tondevrel/scientific-agent-skills/tree/main/skills/xarray
Command: npx skills add https://github.com/tondevrel/scientific-agent-skills --skill xarray-tondevrel

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) and scripts (resource) components.

What problem does it solve?

This Skill simplifies working with complex, multi-dimensional scientific data by providing labeled dimensions and coordinates, making data analysis more intuitive and less error-prone.

Core Features & Use Cases

  • Labeled Arrays: Work with DataArray and Dataset objects that have named dimensions and coordinates.
  • Data Handling: Essential for NetCDF, GRIB, and Zarr files, common in climate, weather, and oceanography.
  • Large Datasets: Seamless integration with Dask for out-of-memory computation.
  • Use Case: Analyze global temperature data stored in a NetCDF file, calculating monthly anomalies and visualizing the results on a map.

Quick Start

Open the file 'weather_data.nc' using xarray and print the dataset.

Frequently Asked Questions about xarray

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I analyze multidimensional NetCDF data in Python?

You can analyze multidimensional NetCDF data using labeled arrays built on NumPy. It provides named dimensions and coordinates, making operations like grouping and resampling intuitive for scientific datasets.

Can I perform out-of-memory computation on large geospatial datasets?

Yes, you can perform out-of-memory computation on large geospatial datasets through seamless integration with Dask. This enables lazy loading and parallel processing for large scientific datasets.

What is the best way to handle metadata when working with GRIB files?

The best way to handle metadata with GRIB files is using N-dimensional labeled arrays. This approach preserves metadata during operations like broadcasting, ensuring data context is maintained.

How do I calculate monthly temperature anomalies from NetCDF files?

You calculate monthly temperature anomalies from NetCDF files by opening the dataset and applying grouping and resampling operations. Labeled dimensions allow you to group by time coordinates and compute deviations.

Does xarray work with Zarr file formats for scientific computing?

Yes, xarray works natively with Zarr file formats for scientific computing. It facilitates intuitive data handling for Zarr, alongside NetCDF and GRIB, ensuring flexible input and output for multidimensional arrays.

Why use labeled arrays instead of raw NumPy for climate data?

You use labeled arrays instead of raw NumPy for climate data to reduce errors and improve intuitiveness. Named dimensions and coordinates replace positional axis indexing, making complex operations clearer.