MCPcopy
hub / github.com/pydata/xarray / normalize_label

Function normalize_label

xarray/core/indexes.py:617–626  ·  view source on GitHub ↗
(value, dtype=None)

Source from the content-addressed store, hash-verified

615
616
617def normalize_label(value, dtype=None) -> np.ndarray:
618 if getattr(value, "ndim", 1) <= 1:
619 value = _asarray_tuplesafe(value)
620 if dtype is not None and dtype.kind == "f" and value.dtype.kind != "b":
621 # pd.Index built from coordinate with float precision != 64
622 # see https://github.com/pydata/xarray/pull/3153 for details
623 # bypass coercing dtype for boolean indexers (ignore index)
624 # see https://github.com/pydata/xarray/issues/5727
625 value = np.asarray(value, dtype=dtype)
626 return value
627
628
629def as_scalar(value: np.ndarray):

Callers 2

selMethod · 0.85
selMethod · 0.85

Calls 1

_asarray_tuplesafeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…