MCPcopy Index your code
hub / github.com/pydata/xarray / get_value

Method get_value

xarray/coding/cftimeindex.py:433–440  ·  view source on GitHub ↗

Adapted from pandas.tseries.index.DatetimeIndex.get_value

(self, series, key)

Source from the content-addressed store, hash-verified

431 # TODO: Add ability to use integer range outside of iloc?
432 # e.g. series[1:5].
433 def get_value(self, series, key):
434 """Adapted from pandas.tseries.index.DatetimeIndex.get_value"""
435 if np.asarray(key).dtype == np.dtype(bool):
436 return series.iloc[key]
437 elif isinstance(key, slice):
438 return series.iloc[self.slice_indexer(key.start, key.stop, key.step)]
439 else:
440 return series.iloc[self.get_loc(key)]
441
442 def __contains__(self, key: Any) -> bool:
443 """Adapted from

Callers

nothing calls this directly

Calls 2

get_locMethod · 0.95
dtypeMethod · 0.45

Tested by

no test coverage detected