Skip to main content

xarray integration with sklearn

Project description

Travis AppVeyor Coverage PyPI


sklearn-xarray is an open-source python package that combines the n-dimensional labeled arrays of xarray with the machine learning and model selection tools of scikit-learn. The package contains wrappers that allow the user to apply scikit-learn estimators to xarray types without losing their labels.


The package documentation can be found at


  • Makes sklearn estimators compatible with xarray DataArrays and Datasets.
  • Allows for estimators to change the number of samples.
  • Adds a large number of pre-processing transformers.


Required dependencies:

  • Python 2.7, 3.4, 3.5, or 3.6
  • scikit-learn (0.19 or later, depends on numpy & scipy)
  • xarray (0.10 or later)
  • pandas (0.20 or later)

The package can be installed from pip:

$ pip install sklearn-xarray

For the latest version, you can also install from source:

$ pip install


The activity recognition example demonstrates how to use the package for cross-validated grid search for an activity recognition task. The example is also present as a jupyter notebook.


Please read the contribution guide if you want to contribute to this project.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for sklearn-xarray, version 0.3.0
Filename, size File type Python version Upload date Hashes
Filename, size sklearn-xarray-0.3.0.tar.gz (31.4 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page