Skip to content

Commit 9dbe8c2

Browse files
author
Taher Chegini
committed
ENH: Address the future warning in groupby by setting observed=True. [skip ci]
1 parent 74bc67f commit 9dbe8c2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

py3dep/py3dep.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@ def __get_idx(d_sp: npt.NDArray[np.float64], distance: float) -> npt.NDArray[np.
494494
"""Get the index of the closest point to a given distance."""
495495
dis = pd.DataFrame(d_sp, columns=["distance"]).reset_index()
496496
grouper = pd.cut(dis.distance, np.arange(0, dis.distance.max() + distance, distance))
497-
return dis.groupby(grouper).last()["index"].to_numpy()
497+
return dis.groupby(grouper, observed=True).last()["index"].to_numpy()
498498

499499

500500
def __get_spline_params(

0 commit comments

Comments
 (0)