{ } Raw JSON

bundles / scipy 1.18.0 / scipy / stats / _multivariate / random_table_gen / mean

function

scipy.stats._multivariate:random_table_gen.mean

source: /scipy/stats/_multivariate.py:6296

Signature

def mean(self, row, col)

Summary

Mean of distribution of conditional tables.

Parameters

row : array_like

Sum of table entries in each row.

col : array_like

Sum of table entries in each column.

Returns

: mean: ndarray

Mean of the distribution.

Notes

The row and column vectors must be one-dimensional, not empty, and each sum up to the same value. They cannot contain negative or noninteger entries.

Examples

from scipy.stats import random_table
✓
row = [1, 5]
col = [2, 3, 1]
✓
random_table.mean(row, col)
✗
array([[0.33333, 0.5    , 0.16667],
       [1.66667, 2.5    , 0.83333]])
Alternatively, the object may be called (as a function) to fix the row and column vector sums, returning a "frozen" distribution.
d = random_table(row, col)
✓
d.mean()
✗
array([[0.33333, 0.5    , 0.16667],
       [1.66667, 2.5    , 0.83333]])

Aliases

  • scipy.stats._multivariate.random_table_gen.mean