Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Function warning when sequence is all np.nan #9870

Open
Breeze-Hu opened this issue Dec 10, 2024 · 0 comments
Open

Function warning when sequence is all np.nan #9870

Breeze-Hu opened this issue Dec 10, 2024 · 0 comments
Labels
needs triage Issue that has not been reviewed by xarray team member

Comments

@Breeze-Hu
Copy link

What is your issue?

When processing the data, even with the bottleneck package installed, there is still a Warning when the sequence is empty. is it because bottleneck can't handle the .quantile function and still ends up calling the numpy function?

bottleneck: speeds up NaN-skipping and rolling window aggregations by a large factor

import xarray as xr
import numpy as np
array = np.random.randn(3,5,5)
array[:,2,2]=np.nan
data = xr.DataArray(array,
                    coords={'time': np.arange(3),
                            'lon': np.arange(5),
                            'lat': np.arange(5)}
                            )
data.quantile(0.95,dim='time', method='median_unbiased')
/home/yu/miniconda3/envs/learn/lib/python3.11/site-packages/numpy/lib/nanfunctions.py:1563: RuntimeWarning: All-NaN slice encountered
  return function_base._ureduce(a,

image

@Breeze-Hu Breeze-Hu added the needs triage Issue that has not been reviewed by xarray team member label Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage Issue that has not been reviewed by xarray team member
Projects
None yet
Development

No branches or pull requests

1 participant