pydata / pydata/xarray

confusing dataset creation process

Open
#1,249 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

In another issue I create a simple dataset like so:

lat = np.random.rand(50000) * 180 - 90
lon = np.random.rand(50000) * 360 - 180
d = xr.Dataset({'latitude':lat, 'longitude':lon})

I expected d to contain two variables (latitude and longitude) with no coordinates. Instead d appears to contain two coordinates and no variables:

In [5]: d
Out[5]: 
<xarray.Dataset>
Dimensions:    (latitude: 50000, longitude: 50000)
Coordinates:
  * latitude   (latitude) float64 -76.0 -84.36 26.69 66.44 -37.85 50.13 ...
  * longitude  (longitude) float64 -148.7 -74.82 18.37 117.7 80.63 12.25 ...
Data variables:
    *empty*

Is this desired behavior?

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

Reproduce the NumPy example and start at the xarray.Dataset constructor to understand how the supplied arrays are classified. Done means establishing whether the resulting coordinates and empty data-variable section are intended, then identifying the corresponding behavior or documentation change.

Written by the indexing model from the issue text.

Assessment

Tech stack
numpy, python
Domain
data
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.