Given an n-dimensional contingency table of observed frequencies,
compute the expected frequencies for the table based on the marginal
sums under the assumption that the groups associated with each
dimension are independent.

Parameters :

observed : array_like

The table of observed frequencies. (While this function can handle
a 1-D array, that case is trivial. Generally observed is at
least 2-D.)