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

Method get_unique

xarray/core/indexes.py:1794–1806  ·  view source on GitHub ↗

Return a list of unique indexes, preserving order.

(self)

Source from the content-addressed store, hash-verified

1792 return type(self)(dict(self._indexes), dict(self._variables))
1793
1794 def get_unique(self) -> list[T_PandasOrXarrayIndex]:
1795 """Return a list of unique indexes, preserving order."""
1796
1797 unique_indexes: list[T_PandasOrXarrayIndex] = []
1798 seen: set[int] = set()
1799
1800 for index in self._indexes.values():
1801 index_id = id(index)
1802 if index_id not in seen:
1803 unique_indexes.append(index)
1804 seen.add(index_id)
1805
1806 return unique_indexes
1807
1808 def is_multi(self, key: Hashable) -> bool:
1809 """Return True if ``key`` maps to a multi-coordinate index,

Callers 3

_id_indexMethod · 0.95
_assert_valid_xyFunction · 0.80
test_get_uniqueMethod · 0.80

Calls 2

valuesMethod · 0.45
addMethod · 0.45

Tested by 1

test_get_uniqueMethod · 0.64