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.1.0.tar.gz (23.7 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.1.0-py3-none-any.whl (21.4 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for xrscipy-3.1.0.tar.gz
Algorithm Hash digest
SHA256 5d6d27d78234185ba9b709a6bcc4ec07f7f0260250bd0a5eb1ead340ae038086
MD5 c83a1e6541268166a3b77ff3b7407c9f
BLAKE2b-256 3757adcd6c3f31776f4fdfaa657c08246de0d595fe870315bb6c6a55ba4aa599

See more details on using hashes here.

File details

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

File metadata

  • Download URL: xrscipy-3.1.0-py3-none-any.whl
  • Upload date:
  • Size: 21.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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 34c3eebd682230648b52586c7d84c634061401a63530934dc8f477ec7eb14533
MD5 2c1aadb6b8f5541eef63ee5f8ce7a61e
BLAKE2b-256 a2789f27e68b155fed9e7916b2a48faedda19d7152d3dbd4670940bfc130d0d9

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