Numpy to xarray docs
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 4.2k
- Forks
- 1.4k
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 14
Description
We should make a docs page specifically to ease the transition from pure-numpy to xarray.
A lot of new xarray users come from already using numpy as their primary data structure. We relatively often get questions about "what's the xarray equivalent of X numpy function" but we don't have a dedicated place to collect those answers, or explain key conceptual differences.
I think this deserves its own dedicated docs page, with:
- High-level conceptual differences (e.g. transpose invariance)
- Arguments for the benefits of using xarray over pure numpy
- Table of numpy <-> xarray function equivalents (similar to the existing "How do I..." page)
- Other common recommendations for numpy users (e.g. use netCDF / Zarr instead of
.npzor pickle to store data on disk)
For the table I thought of a few already, but I know there will be a lot more:
np.concatenate/np.vstack/np.hstack/np.stack→xr.concatnp.block→xr.combine_nestednp.apply_along_axis→xr.apply_ufuncnp.polynomial→xr.polyfitnp.reshape->xr.coarsen().construct()
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
Start by locating the existing "How do I..." documentation page and reviewing how it presents function equivalents. Create a dedicated NumPy-to-xarray page covering the listed conceptual differences, benefits, equivalent functions, and storage recommendations, with the requested mappings included.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- numpy, python
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100