Skip to content

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

Closed
@OrionSmedley

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

import xarray as xr
import numpy as np
data = 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

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