'Construct a Table object from data.
Parameters
data : array-like
The raw data, the first column defines the rows and the
second column defines the columns.
shift_zeros : boolean
If True, and if there are any zeros in the contingency
table, add 0.5 to all four cells of the table.'

@classmethod
def from_data(cls, data, shift_zeros=True):

    if isinstance(data, pd.DataFrame):
        table = pd.crosstab(data.iloc[:, 0], data.iloc[:, 1])
    else:
        table = pd.crosstab(data[:, 0], data[:, 1])
    return cls(table, shift_zeros)
