Provide a "shrink" command to remove bounding nan/ whitespace of DataArray
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 4.2k
- Forks
- 1.4k
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 14
Description
I'm currently trying to come up with an elegant solution to remove extra whitespace/ nan-values along the edges of a 2D DataArray. I'm working with geographic data and search for an automatic way to shrink the extend to valid data only. Think a map of the EU, but remove all cols/ rows of the array (starting from the edges) that only contain nan.
Describe the solution you'd like
A shrink command that removes all nan rows/ cols at the edges of a DataArray.
Describe alternatives you've considered
I currently do this with NumPy operating on the raw data and creating a new DataArray afterwards
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
The issue identifies DataArray and NumPy as the relevant entry points; start by reviewing existing DataArray indexing and trimming behavior and the NumPy-based workaround described. Done means a shrink operation removes only all-NaN rows and columns from the edges of a 2D DataArray while preserving valid data.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- numpy, python
- Domain
- data
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100