feat(rust, python): Return datetime for mean/median of Date colum #16795
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Old PR was pretty stale, so here is a new one.
Resolves #13598. Part of overall #13599.
This treats dates and datetimes as analagous to integers/floats: the mean of ints is a float, and now the mean of dates is a datetime:
This is the last temporal mean/median PR, which means a lot of custom logic for the different temporal types has been collapsed/simplified. If this is accepted, we can deprecate
dt.mean
anddt.median
, as mean/median for all temporals have now been implemented, they are now functionally equivalent toseries.mean
andseries.median
for all temporal dtypes. I'll do a followup onstd
/var
/quantile
.Note that this breaks streaming date mean/median, and so for the time being I have set it to return a null series. I don't want to hack in a solution since a new streaming engine is being developed, so in the meantime I'm not completely sure what to do.