@@ -216,7 +216,7 @@ def _reconstruct_data(
216216 values = cls ._from_sequence (values , dtype = dtype ) # type: ignore[assignment]
217217
218218 else :
219- values = values .astype (dtype , copy = False ) # type: ignore[assignment]
219+ values = values .astype (dtype , copy = False )
220220
221221 return values
222222
@@ -904,7 +904,10 @@ def value_counts_internal(
904904 .size ()
905905 )
906906 result .index .names = values .names
907- counts = result ._values
907+ # error: Incompatible types in assignment (expression has type
908+ # "ndarray[Any, Any] | DatetimeArray | TimedeltaArray | PeriodArray | Any",
909+ # variable has type "ndarray[tuple[int, ...], dtype[Any]]")
910+ counts = result ._values # type: ignore[assignment]
908911
909912 else :
910913 values = _ensure_arraylike (values , func_name = "value_counts" )
@@ -1311,7 +1314,7 @@ def searchsorted(
13111314_diff_special = {"float64" , "float32" , "int64" , "int32" , "int16" , "int8" }
13121315
13131316
1314- def diff (arr , n : int , axis : AxisInt = 0 ):
1317+ def diff (arr , n : int | float | np . integer | np . floating , axis : AxisInt = 0 ):
13151318 """
13161319 difference of n between self,
13171320 analogous to s-s.shift(n)
@@ -1400,7 +1403,7 @@ def diff(arr, n: int, axis: AxisInt = 0):
14001403 if arr .dtype .name in _diff_special :
14011404 # TODO: can diff_2d dtype specialization troubles be fixed by defining
14021405 # out_arr inside diff_2d?
1403- algos .diff_2d (arr , out_arr , n , axis , datetimelike = is_timedelta )
1406+ algos .diff_2d (arr , out_arr , int ( n ) , axis , datetimelike = is_timedelta )
14041407 else :
14051408 # To keep mypy happy, _res_indexer is a list while res_indexer is
14061409 # a tuple, ditto for lag_indexer.
0 commit comments