(self, freq, mode, ambiguous, nonexistent)
| 2094 | return super().__array_ufunc__(ufunc, method, *inputs, **kwargs) |
| 2095 | |
| 2096 | def _round(self, freq, mode, ambiguous, nonexistent): |
| 2097 | # round the local times |
| 2098 | if isinstance(self.dtype, DatetimeTZDtype): |
| 2099 | # operate on naive timestamps, then convert back to aware |
| 2100 | self = cast("DatetimeArray", self) |
| 2101 | naive = self.tz_localize(None) |
| 2102 | result = naive._round(freq, mode, ambiguous, nonexistent) |
| 2103 | return result.tz_localize( |
| 2104 | self.tz, ambiguous=ambiguous, nonexistent=nonexistent |
| 2105 | ) |
| 2106 | |
| 2107 | values = self.view("i8") |
| 2108 | values = cast(np.ndarray, values) |
| 2109 | nanos = get_unit_for_round(freq, self._creso) |
| 2110 | if nanos == 0: |
| 2111 | # GH 52761 |
| 2112 | return self.copy() |
| 2113 | result_i8 = round_nsint64(values, mode, nanos) |
| 2114 | result = self._maybe_mask_results(result_i8, fill_value=iNaT) |
| 2115 | result = result.view(self._ndarray.dtype) |
| 2116 | return self._simple_new(result, dtype=self.dtype) |
| 2117 | |
| 2118 | def round( |
| 2119 | self, |
no test coverage detected