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

Method round

xarray/core/accessor_dt.py:302–316  ·  view source on GitHub ↗

Round timestamps to specified frequency resolution. Parameters ---------- freq : str a freq string indicating the rounding resolution e.g. "D" for daily resolution Returns ------- rounded timestamps : same type as values

(self, freq: str)

Source from the content-addressed store, hash-verified

300 return self._tslib_round_accessor("ceil", freq)
301
302 def round(self, freq: str) -> T_DataArray:
303 """
304 Round timestamps to specified frequency resolution.
305
306 Parameters
307 ----------
308 freq : str
309 a freq string indicating the rounding resolution e.g. "D" for daily resolution
310
311 Returns
312 -------
313 rounded timestamps : same type as values
314 Array-like of datetime fields accessed for each element in values
315 """
316 return self._tslib_round_accessor("round", freq)
317
318
319class DatetimeAccessor(TimeAccessor[T_DataArray]):

Callers 10

interpMethod · 0.45
roundFunction · 0.45
selMethod · 0.45
selMethod · 0.45
test_unary_opMethod · 0.45
test_unary_opsMethod · 0.45
test_roundFunction · 0.45
test_roundMethod · 0.45
test_unary_opMethod · 0.45

Calls 1

_tslib_round_accessorMethod · 0.95

Tested by 6

test_unary_opMethod · 0.36
test_unary_opsMethod · 0.36
test_roundFunction · 0.36
test_roundMethod · 0.36
test_unary_opMethod · 0.36