Skip to content

Add option to apply reduction operations also to coordinates instead of dropping them. #8317

Description

@JulianGiles

Is your feature request related to a problem?

Applying reduction operations like .mean() to a Dataset or DataArray will remove all coordinates that have the reduced dimension.

Describe the solution you'd like

I would like a keyword argument (reduce_coords?) in the reduction method to allow for the reduction to also be applied to the coordinates.

Describe alternatives you've considered

A current solution is to promote the coordinates to variables, perform the reduction and then demote them back to coordinates, like in #1497 . But it would be nice to have a faster way of doing it, like in #3033 with keepdims=True to retain the dimensions after a reduction.

Additional context

No response

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions