Skip to content

Add boundaries keyword for resample#10865

Open
gcaria wants to merge 3 commits into
pydata:mainfrom
gcaria:add_boundaries_keyword_resample
Open

Add boundaries keyword for resample#10865
gcaria wants to merge 3 commits into
pydata:mainfrom
gcaria:add_boundaries_keyword_resample

Conversation

@gcaria
Copy link
Copy Markdown
Contributor

@gcaria gcaria commented Oct 17, 2025

Comment thread xarray/core/common.py
offset: pd.Timedelta | datetime.timedelta | str | None,
origin: str | DatetimeLike,
restore_coord_dims: bool | None,
boundaries: Literal["exact", "trim"] | None = None,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shall we use drop_incomplete: bool like in SeasonResampler? Note that you could be missing data in the middle too...

Comment thread xarray/core/common.py Outdated
Comment thread xarray/core/common.py Outdated
Comment on lines +1147 to +1149
unique_counts, count_frequencies = np.unique(
counts, return_counts=True
)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems wrong, for example what about a time series starting or ending in february --- this will always have fewer points even if all of february is included

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Trim option for DataArray.resample()

2 participants