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-2.2.0.tar.gz (10.5 kB view details)

Uploaded Source

Built Distribution

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

xrscipy-2.2.0-py3-none-any.whl (10.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for xrscipy-2.2.0.tar.gz
Algorithm Hash digest
SHA256 b38416dd6b8f265227d02c2574499b298ea6abcb1a67a2a8a24ad179ca7f1e9a
MD5 d3833b7900e96c447fb8d3fe4edb47ec
BLAKE2b-256 1bb8e837d0e323c3a833de7bdec275c66daa9ad8ad630c44bc6bcc0ae4d0df7f

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for xrscipy-2.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1e09ee24bfff5e541b0d1ded2060a8ad077ce9f663f483e7e01365e1c0929f77
MD5 9879f4629c7145cdcd3911d8f0f6b980
BLAKE2b-256 caf3ae56675d1d4c2e3209863c516d9c6a15af445d19582a6749391d4a0f34b2

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