np_datetime.pyi 831 B

123456789101112131415161718192021222324252627
  1. import numpy as np
  2. from pandas._typing import npt
  3. class OutOfBoundsDatetime(ValueError): ...
  4. class OutOfBoundsTimedelta(ValueError): ...
  5. # only exposed for testing
  6. def py_get_unit_from_dtype(dtype: np.dtype): ...
  7. def py_td64_to_tdstruct(td64: int, unit: int) -> dict: ...
  8. def astype_overflowsafe(
  9. values: np.ndarray,
  10. dtype: np.dtype,
  11. copy: bool = ...,
  12. round_ok: bool = ...,
  13. is_coerce: bool = ...,
  14. ) -> np.ndarray: ...
  15. def is_unitless(dtype: np.dtype) -> bool: ...
  16. def compare_mismatched_resolutions(
  17. left: np.ndarray, right: np.ndarray, op
  18. ) -> npt.NDArray[np.bool_]: ...
  19. def add_overflowsafe(
  20. left: npt.NDArray[np.int64],
  21. right: npt.NDArray[np.int64],
  22. ) -> npt.NDArray[np.int64]: ...
  23. def get_supported_dtype(dtype: np.dtype) -> np.dtype: ...
  24. def is_supported_dtype(dtype: np.dtype) -> bool: ...