You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`result = [[stdlib_stats(module):median(interface)]](array, dim [, mask])`
216
+
217
+
### Class
218
+
219
+
Generic subroutine
220
+
221
+
### Arguments
222
+
223
+
`array`: Shall be an array of type `integer` or `real`.
224
+
225
+
`dim`: Shall be a scalar of type `integer` with a value in the range from 1 to `n`, where `n` is the rank of `array`.
226
+
227
+
`mask` (optional): Shall be of type `logical` and either a scalar or an array of the same shape as `array`.
228
+
229
+
### Return value
230
+
231
+
If `array` is of type `real`, the result is of type `real` with the same kind as `array`.
232
+
If `array` is of type `real` and contains IEEE `NaN`, the result is IEEE `NaN`.
233
+
If `array` is of type `integer`, the result is of type `real(dp)`.
234
+
235
+
If `dim` is absent, a scalar with the median of all elements in `array` is returned. Otherwise, an array of rank `n-1`, where `n` equals the rank of `array`, and a shape similar to that of `array` with dimension `dim` dropped is returned.
236
+
237
+
If `mask` is specified, the result is the median of all elements of `array` corresponding to `true` elements of `mask`. If every element of `mask` is `false`, the result is IEEE `NaN`.
0 commit comments