Return the number of microseconds since midnight. Returns ------- ndarray[int64_t]
(self)
| 794 | # -------------------------------------------------------------------- |
| 795 | |
| 796 | def _get_time_micros(self) -> npt.NDArray[np.int64]: |
| 797 | """ |
| 798 | Return the number of microseconds since midnight. |
| 799 | |
| 800 | Returns |
| 801 | ------- |
| 802 | ndarray[int64_t] |
| 803 | """ |
| 804 | values = self._data._local_timestamps() |
| 805 | |
| 806 | ppd = periods_per_day(self._data._creso) |
| 807 | |
| 808 | frac = values % ppd |
| 809 | if self.unit == "ns": |
| 810 | micros = frac // 1000 |
| 811 | elif self.unit == "us": |
| 812 | micros = frac |
| 813 | elif self.unit == "ms": |
| 814 | micros = frac * 1000 |
| 815 | elif self.unit == "s": |
| 816 | micros = frac * 1_000_000 |
| 817 | else: # pragma: no cover |
| 818 | raise NotImplementedError(self.unit) |
| 819 | |
| 820 | micros[self._isnan] = -1 |
| 821 | return micros |
| 822 | |
| 823 | def snap(self, freq: Frequency = "S") -> DatetimeIndex: |
| 824 | """ |
no test coverage detected