We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6a70067 commit 26e2cd9Copy full SHA for 26e2cd9
pandas/core/reshape/tile.py
@@ -4,6 +4,7 @@
4
from typing import (
5
Any,
6
Callable,
7
+ Literal,
8
)
9
10
import numpy as np
@@ -417,12 +418,8 @@ def _bins_to_cuts(
417
418
else:
419
bins = unique_bins
420
- side = "left" if right else "right"
421
- # error: No overload variant of "searchsorted" of "ndarray" matches
422
- # argument types "Any", "str"
423
- ids = ensure_platform_int(
424
- bins.searchsorted(x, side=side) # type: ignore[call-overload]
425
- )
+ side: Literal["left", "right"] = "left" if right else "right"
+ ids = ensure_platform_int(bins.searchsorted(x, side=side))
426
427
if include_lowest:
428
ids[np.asarray(x) == bins[0]] = 1
0 commit comments