-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
DEPR: move NumericIndex._convert_tolerance to Index #50932
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3780,6 +3780,17 @@ def _convert_tolerance(self, tolerance, target: np.ndarray | Index) -> np.ndarra | |
tolerance = np.asarray(tolerance) | ||
if target.size != tolerance.size and tolerance.size > 1: | ||
raise ValueError("list-like tolerance size must match target index size") | ||
elif is_numeric_dtype(self) and not np.issubdtype(tolerance.dtype, np.number): | ||
if tolerance.ndim > 0: | ||
raise ValueError( | ||
f"tolerance argument for {type(self).__name__} must contain " | ||
"numeric elements if it is list type" | ||
) | ||
|
||
raise ValueError( | ||
f"tolerance argument for {type(self).__name__} must be numeric " | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, now that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Error messages updated. |
||
f"if it is a scalar: {repr(tolerance)}" | ||
) | ||
return tolerance | ||
|
||
@final | ||
|
Uh oh!
There was an error while loading. Please reload this page.