Now I use group_by and slice to complete this.
station_len = len(self.x['basin_id'].unique())
x_truncated = (self.x.group_by('basin_id', maintain_order=True).agg(pl.all().slice(0, len(self.x) // station_len)).
explode(pl.exclude("basin_id"))