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.1.tar.gz (14.6 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.1-py3-none-any.whl (10.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: xrscipy-3.0.1.tar.gz
  • Upload date:
  • Size: 14.6 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.1.tar.gz
Algorithm Hash digest
SHA256 0b570ad8e5b86fcaca183c96310aa2fde498c628c05dae59562f88fd2707d1b8
MD5 3aabd5209e0a2623c30255ddbdbde3f2
BLAKE2b-256 20fc2f530ad231811fc6a488955b678043bc06899ce3afe8a551dd8b7e7f9945

See more details on using hashes here.

File details

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

File metadata

  • Download URL: xrscipy-3.0.1-py3-none-any.whl
  • Upload date:
  • Size: 10.6 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f10c6cf511c70caae16684da206f25237ac26bedd3ffe9c6281a265b984af6fa
MD5 948824aeef9b54c75f2132f90a02384b
BLAKE2b-256 c4e34ff100dd51fbdc588fe4c5a6d89a407b98379f71c163edf3cb0357bc7ef7

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