home / github / issues

Menu
  • Search all tables
  • GraphQL API

issues: 551344538

This data as json

id node_id number title user state locked assignee milestone comments created_at updated_at closed_at author_association active_lock_reason draft pull_request body reactions performed_via_github_app state_reason repo type
551344538 MDU6SXNzdWU1NTEzNDQ1Mzg= 3701 Error using reduce(): percentile() got an unexpected keyword argument 'axis' 57364981 closed 0     12 2020-01-17T10:51:49Z 2020-01-17T18:18:08Z 2020-01-17T15:24:48Z NONE      

MCVE Code Sample

```python import os import numpy as np import pandas as pd import xarray as xr import gcsfs

Search for available CMIP6 data:

df = pd.read_csv('https://storage.googleapis.com/cmip6/cmip6-zarr-consolidated-stores.csv')

and daily 'tas' data:

df_daily_tas = df[(df.table_id == 'day') & (df.variable_id == 'tas')]

get data for a single model and experiment:

source_id = 'GFDL-CM4' expt_id = 'historical'

define a func to load 'tas' data

def load_tas_data(source_id, expt_id): """ Load daily tas data for given source and expt ids """ uri = df_daily_tas[(df_daily_tas.source_id == source_id) & (df_daily_tas.experiment_id == expt_id)].zstore.values[0]

gcs = gcsfs.GCSFileSystem(token='anon')
ds = xr.open_zarr(gcs.get_mapper(uri), consolidated=True)
return ds

Specify the percentile to look at:

percentile = 99

Load the data:

ds = load_tas_data(source_id, expt_id).sel(time=slice('2000', '2000'))

Get the percentiles at each lat/lon:

percentiles = ds.reduce(np.percentile, q=percentile, dim='time') `` Code above gives following error:TypeError: percentile() got an unexpected keyword argument 'axis'`

Expected Output

Expected code to return percentiles of daily temperature for each latitude and longitude.

Problem Description

Code works fine on a different system with the following modules installed:

INSTALLED VERSIONS ------------------ commit: None python: 3.6.4 |Anaconda, Inc.| (default, Jan 16 2018, 12:04:33) [GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)] python-bits: 64 OS: Darwin OS-release: 14.5.0 machine: x86_64 processor: i386 byteorder: little LC_ALL: None LANG: en_US.UTF-8 LOCALE: en_US.UTF-8 libhdf5: 1.10.1 libnetcdf: 4.4.1.1 xarray: 0.14.1 pandas: 0.25.3 numpy: 1.16.2 scipy: 1.2.1 netCDF4: 1.3.1 pydap: installed h5netcdf: None h5py: 2.7.1 Nio: None zarr: 2.3.2 cftime: 1.0.4.2 nc_time_axis: None PseudoNetCDF: None rasterio: None cfgrib: None iris: None bottleneck: 1.2.1 dask: 0.16.1 distributed: 1.20.2 matplotlib: 2.2.2 cartopy: 0.16.0 seaborn: 0.8.1 numbagg: None setuptools: 38.4.0 pip: 9.0.1 conda: 4.4.10 pytest: 3.3.2 IPython: 6.2.1 sphinx: 1.6.6

Output of xr.show_versions()

Issue occurs on system with the following installed modules:

INSTALLED VERSIONS ------------------ commit: None python: 3.7.6 | packaged by conda-forge | (default, Jan 7 2020, 22:33:48) [GCC 7.3.0] python-bits: 64 OS: Linux OS-release: 4.19.76+ machine: x86_64 processor: x86_64 byteorder: little LC_ALL: en_US.UTF-8 LANG: en_US.UTF-8 LOCALE: en_US.UTF-8 libhdf5: 1.10.5 libnetcdf: 4.6.2 xarray: 0.14.1 pandas: 0.25.3 numpy: 1.17.3 scipy: 1.3.2 netCDF4: 1.5.1.2 pydap: installed h5netcdf: 0.7.4 h5py: 2.10.0 Nio: None zarr: 2.3.2 cftime: 1.0.4.2 nc_time_axis: 1.2.0 PseudoNetCDF: None rasterio: 1.0.25 cfgrib: None iris: 2.2.0 bottleneck: 1.3.1 dask: 2.9.0 distributed: 2.9.0 matplotlib: 3.1.2 cartopy: 0.17.0 seaborn: 0.9.0 numbagg: None setuptools: 44.0.0.post20200102 pip: 19.3.1 conda: None pytest: 5.3.1 IPython: 7.11.1 sphinx: None
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/3701/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  completed 13221727 issue

Links from other tables

  • 0 rows from issues_id in issues_labels
  • 12 rows from issue in issue_comments
Powered by Datasette · Queries took 155.661ms · About: xarray-datasette