mean
Syntax
mean(X)
Details
Calculate the average of X.
-
If X is a matrix, calculate the average of each column and return a vector.
-
If X is a table, calculate the average of each column and return a table.
This function is equivalent to avg.
The calculation skips null values.
The DolphinDB mean function operates on vectors, matrices, and
tables. For matrices and tables, it calculates the column mean by default. There is
no concept of a "global mean"; if you need it, you need to flatten the data
manually. NumPy's mean function is designed for multi-dimensional
arrays. By default, it flattens the input into a one-dimensional array and computes
the global mean. To compute along rows, columns, or multiple axes, you need to
explicitly specify the axis parameter.
Parameters
X is a scalar/vector/matrix/table.
Returns
-
If X is a vector, returns a DOUBLE scalar.
-
If X is a matrix, returns a DOUBLE vector.
-
If X is a table, returns a table.
