@@ -419,7 +419,7 @@ def scatter(self: Self, indices: int | Sequence[int], values: Any) -> Self:
419419 def to_list (self : Self ) -> list [Any ]:
420420 return self ._native_series .to_pylist ()
421421
422- def __array__ (self : Self , dtype : Any = None , copy : bool | None = None ) -> _1DArray :
422+ def __array__ (self : Self , dtype : Any = None , * , copy : bool | None = None ) -> _1DArray :
423423 return self ._native_series .__array__ (dtype = dtype , copy = copy )
424424
425425 def to_numpy (self : Self ) -> _1DArray :
@@ -997,7 +997,7 @@ def rolling_var(
997997 )
998998
999999 cum_sum_sq = (
1000- padded_series . __pow__ ( 2 )
1000+ pow ( padded_series , 2 )
10011001 .cum_sum (reverse = False )
10021002 .fill_null (value = None , strategy = "forward" , limit = None )
10031003 )
@@ -1091,7 +1091,6 @@ def hist( # noqa: PLR0915
10911091 def _hist_from_bin_count (bin_count : int ): # type: ignore[no-untyped-def] # noqa: ANN202
10921092 d = pc .min_max (self ._native_series )
10931093 lower , upper = d ["min" ], d ["max" ]
1094- pad_lowest_bin = False
10951094 pa_float = pa .type_for_alias ("float" )
10961095 if lower == upper :
10971096 range_ = lit (1.0 )
@@ -1100,7 +1099,6 @@ def _hist_from_bin_count(bin_count: int): # type: ignore[no-untyped-def] # noqa
11001099 lower = pc .subtract (lower , mid )
11011100 upper = pc .add (upper , mid )
11021101 else :
1103- pad_lowest_bin = True
11041102 range_ = pc .subtract (upper , lower )
11051103 width = pc .divide (pc .cast (range_ , pa_float ), lit (float (bin_count )))
11061104
@@ -1151,15 +1149,7 @@ def _hist_from_bin_count(bin_count: int): # type: ignore[no-untyped-def] # noqa
11511149 # extract left/right side of the intervals
11521150 bin_left = pc .add (lower , pc .multiply (counts .column ("values" ), width ))
11531151 bin_right = pc .add (bin_left , width )
1154- if pad_lowest_bin :
1155- # pad lowest bin by 1% of range
1156- lowest_padded = [
1157- pc .subtract (
1158- bin_left [0 ], pc .multiply (pc .cast (range_ , pa_float ), lit (0.001 ))
1159- )
1160- ]
1161- bin_left = chunked_array ([lowest_padded , cast ("Any" , bin_left [1 :])])
1162- return counts .column ("counts" ), bin_left , bin_right
1152+ return counts .column ("counts" ), bin_right
11631153
11641154 def _hist_from_bins (bins : Sequence [int | float ]): # type: ignore[no-untyped-def] # noqa: ANN202
11651155 bin_indices = np .searchsorted (bins , self ._native_series , side = "left" )
@@ -1169,20 +1159,19 @@ def _hist_from_bins(bins: Sequence[int | float]): # type: ignore[no-untyped-def
11691159 counts [np .isin (obj_cats , obs_cats )] = obs_counts [np .isin (obs_cats , obj_cats )]
11701160
11711161 bin_right = bins [1 :]
1172- bin_left = bins [:- 1 ]
1173- return counts , bin_left , bin_right
1162+ return counts , bin_right
11741163
11751164 if bins is not None :
11761165 if len (bins ) < 2 :
1177- counts , bin_left , bin_right = [], [], []
1166+ counts , bin_right = [], []
11781167 else :
1179- counts , bin_left , bin_right = _hist_from_bins (bins )
1168+ counts , bin_right = _hist_from_bins (bins )
11801169
11811170 elif bin_count is not None :
11821171 if bin_count == 0 :
1183- counts , bin_left , bin_right = [], [], []
1172+ counts , bin_right = [], []
11841173 else :
1185- counts , bin_left , bin_right = _hist_from_bin_count (bin_count )
1174+ counts , bin_right = _hist_from_bin_count (bin_count )
11861175
11871176 else : # pragma: no cover
11881177 # caller guarantees that either bins or bin_count is specified
0 commit comments