pydata / pydata/xarray

Smarter Dataset quantile method?

Open
#8,752 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
4.2k
Forks
1.4k
Avg merge
2d 15h
Merged PRs (30d)
14

Description

What is your issue?

Calling ds.quantile(..., dim="x") result in all data variables in ds being modified to have a quantile dimension regardless of whether they had x as a dimension to begin with.

Is this intended? Can ds.quantile(..., dim="x") be called such that only data variables in ds that had x as a dimension end up with the x dimension being replaced by quantile dimension?

In my case I have a dimensionless data variable which I want to keep dimensionless. I know workaround are to either decode_coords="all" beforehand, or to do something like ds[my_dimensionless_var].isel(quantile=-1, drop=True) afterwards... but just checking if that is expected behaviour.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No source file, test, or entry point is named. Start by reproducing ds.quantile(..., dim="x") with a dimensionless data variable and a variable using x, then determine the intended dimension behavior; done means the expected treatment is documented or covered by an agreed change.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.