Skip to main content

Scipy integrated into xarray

Project description

Documentation Status

scipy for xarray

xr-scipy is a thin wrapper of scipy for the xarray eco-system. You can read the documentation here.

Many scipy functions, such as scipy.integrate.trapezoid requires coordinate array as an argument. xr-scipy wraps these functions to use native coordinate objects of xarray and returns an xarray object with the computed data. This enables more xarray-oriented data analysis with scipy.

Other usage/options are kept almost the same as the original scipy function.

Example

import xarray as xr
import numpy as np
import xrscipy.integrate

In[1]: da = xr.DataArray([0, 3, 2, 4, 6], coords={'x': np.linspace(0, 1, 5)})
In[2]: da
Out[2]:
<xarray.DataArray (x: 5)>
array([0, 3, 2, 4, 6])
Coordinates:
  * x        (x) float64 0.0 0.25 0.5 0.75 1.0

In[3]: xrscipy.integrate.cumulative_trapezoid(da, coord='x')
Out[3]:
<xarray.DataArray (x: 5)>
array([0.   , 0.375, 1.   , 1.75 , 3.   ])
Coordinates:
  * x        (x) float64 0.0 0.25 0.5 0.75 1.0

Installation

pip install xrscipy

Project details


Download files

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

Source Distribution

xrscipy-3.0.2.tar.gz (22.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

xrscipy-3.0.2-py3-none-any.whl (20.4 kB view details)

Uploaded Python 3

File details

Details for the file xrscipy-3.0.2.tar.gz.

File metadata

  • Download URL: xrscipy-3.0.2.tar.gz
  • Upload date:
  • Size: 22.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for xrscipy-3.0.2.tar.gz
Algorithm Hash digest
SHA256 d3aef5fb57de89b58c7c9f3158123608e307eb504f5f569feab32f69bf733f4a
MD5 542060ddaaf2ca1b1e343c0d96c7eed8
BLAKE2b-256 8f687d615aacaece533cdba18865f3d935f7461a0ca6d51c3c7e8f99366b6d95

See more details on using hashes here.

File details

Details for the file xrscipy-3.0.2-py3-none-any.whl.

File metadata

  • Download URL: xrscipy-3.0.2-py3-none-any.whl
  • Upload date:
  • Size: 20.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for xrscipy-3.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 2db159c32aed50aae5f53c7c76ac78bf3e6ddc6494bf1f3aaf0c9936fb0f5277
MD5 39e7236fddd4fb2c3d6607dc24f49e86
BLAKE2b-256 adb5cda82e3116e03ad7093d91394ee786ec7ed02eeaeda5ee1f1703ab10c843

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page