Skip to content

Typo about "len(arr.dims) <= len(arr.coords) in general" #7929

Description

@OrionSmedley

What happened?

Its on the website https://docs.xarray.dev/en/stable/user-guide/terminology.html, but isn't true in general.

What did you expect to happen?

the following code should return true, if the website is correct.

Minimal Complete Verifiable Example

importxarrayasxrimportnumpyasnpdata=xr.DataArray(np.random.randn(2, 3), dims=("x", "y"), coords={"x": [10, 20]})
print(len(data.dims ))
print(len(data.coords))
print( len(data.dims) <=len(data.coords) )

MVCE confirmation

  • Minimal example — the example is as focused as reasonably possible to demonstrate the underlying issue in xarray.
  • Complete example — the example is self-contained, including all data and the text of any traceback.
  • Verifiable example — the example copy & pastes into an IPython prompt or Binder notebook, returning the result.
  • New issue — a search of GitHub Issues suggests this is not a duplicate.

Relevant log output

No response

Anything else we need to know?

No response

Environment

Details

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions