(self, tolerance, target: np.ndarray | Index)
| 3883 | ) |
| 3884 | |
| 3885 | def _convert_tolerance(self, tolerance, target: np.ndarray | Index) -> np.ndarray: |
| 3886 | # override this method on subclasses |
| 3887 | tolerance = np.asarray(tolerance) |
| 3888 | if target.size != tolerance.size and tolerance.size > 1: |
| 3889 | raise ValueError("list-like tolerance size must match target index size") |
| 3890 | elif is_numeric_dtype(self) and not np.issubdtype(tolerance.dtype, np.number): |
| 3891 | if tolerance.ndim > 0: |
| 3892 | raise ValueError( |
| 3893 | f"tolerance argument for {type(self).__name__} with dtype " |
| 3894 | f"{self.dtype} must contain numeric elements if it is list type" |
| 3895 | ) |
| 3896 | |
| 3897 | raise ValueError( |
| 3898 | f"tolerance argument for {type(self).__name__} with dtype {self.dtype} " |
| 3899 | f"must be numeric if it is a scalar: {tolerance!r}" |
| 3900 | ) |
| 3901 | return tolerance |
| 3902 | |
| 3903 | @final |
| 3904 | def _get_fill_indexer( |
no test coverage detected