Choosing an axis - 5.2 English - 68552

AOCL API Guide (68552)

Document ID
68552
Release Date
2025-12-29
Version
5.2 English

Most statistical quantities can be computed by column, by row or for the data matrix overall.

This is specified using the axis function parameter.

The axis parameter can take the following values:

  • 'col' - statistical quantities will be computed for each column of the data matrix

  • 'row' - statistical quantities will be computed for each row of the data matrix

  • 'all' - statistical quantities will be computed for the whole data matrix

For example, if the function mean() is called with the axis argument set to col, then n_cols means will be computed, one for each column. If the axis argument is set to all, then a single mean will be computed.

Note that the functions in this chapter do not check for the presence of NaNs in your input data.

This is specified using the da_axis enum.

The da_axis enum can take the following values:

  • da_axis_col - statistical quantities will be computed for each column of the data matrix

  • da_axis_row - statistical quantities will be computed for each row of the data matrix

  • da_axis_all - statistical quantities will be computed for the whole data matrix

For example, if the routine da_mean_s() is called with the da_axis argument set to da_axis_col, then n_cols means will be computed, one for each column. If the da_axis argument is set to da_axis_all, then a single mean will be computed.

The functions in this chapter do not check for the presence of NaNs in your input data. You can use the da_check_data_s() function to check for NaNs in your data.