Use `ddof=1` for `std` & `var`
Open
Nobody has claimed this yet.
topic-arrays
- Dominant language
- Python
- Stars
- 4.2k
- Forks
- 1.4k
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 14
Description
What is your issue?
I've discussed this a bunch with @dcherian (though I'm not sure he necessarily agrees, I'll let him comment)
Currently xarray uses ddof=0 for std & var. This is:
- Rarely what someone actually wants — xarray data is almost always a sample of some underlying distribution, for which
ddof=1is correct - Inconsistent with pandas
OTOH:
- It is consistent with numpy
- It wouldn't be a painless change — folks who don't read deprecation messages would see values change very slightly
Any thoughts?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Review xarray's std and var entry points, then compare their current ddof=0 behavior with the linked NumPy and pandas conventions. Done requires a maintainer decision on whether the defaults should change and how the compatibility impact, including deprecation messaging, should be handled.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- numpy, pandas, python
- Domain
- data
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100