Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion docs/src/UserGuide/compute.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,9 @@ Reduce the time dimension by calculating the average value of all points in time
import Statistics: mean
mapslices(mean, a, dims="time")
````
There is no time dimension left, because there is only one value left after averaging all time steps.

The time dimension has only a single value indicating the time interval that was used for the average. To remove this singleton dimension you can use `dropdims`.
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think this is necessary anymore since now the behavior is the same as in Base. Maybe just a tip admonition, like below? (Not sure this is the right format for DocumenterVitepress 😅)

> [!TIP]
> To remove the time dimension, use the `dropdims = true` keyword.


We can also calculate spatial means resulting in one value per time step:

````@example compute
Expand Down
Loading