'Bind data to the statespace representation
Parameters
endog : array
Endogenous data to bind to the model. Must be column-ordered
ndarray with shape (`k_endog`, `nobs`) or row-ordered ndarray with
shape (`nobs`, `k_endog`).
Notes
The strict requirements arise because the underlying statespace and
Kalman filtering classes require Fortran-ordered arrays in the wide
format (shaped (`k_endog`, `nobs`)), and this structure is setup to
prevent copying arrays in memory.
By default, numpy arrays are row (C)-ordered and most time series are
represented in the long format (with time on the 0-th axis). In this
case, no copying or re-ordering needs to be performed, instead the
array can simply be transposed to get it in the right order and shape.
Although this class (Representation) has stringent `bind` requirements,
it is assumed that it will rarely be used directly.'

def bind(self, endog):

    if (not isinstance(endog, np.ndarray)):
        raise ValueError('Invalid    endogenous    array;    must    be    an    ndarray.')
    if (endog.ndim == 1):
        if (self.k_endog == 1):
            endog.shape = (endog.shape[0], 1)
        else:
            endog.shape = (1, endog.shape[0])
    if (not (endog.ndim == 2)):
        raise ValueError('Invalid    endogenous    array    provided;    must    be    2-dimensional.')
    if (endog.flags['F_CONTIGUOUS'] and (endog.shape[0] == self.k_endog)):
        pass
    elif (endog.flags['C_CONTIGUOUS'] and (endog.shape[1] == self.k_endog)):
        endog = endog.T
    elif endog.flags['F_CONTIGUOUS']:
        raise ValueError('Invalid    endogenous    array;    column-ordered    arrays    must    have    first    axis    shape    of    `k_endog`.')
    elif endog.flags['C_CONTIGUOUS']:
        raise ValueError('Invalid    endogenous    array;    row-ordered    arrays    must    have    last    axis    shape    of    `k_endog`.')
    else:
        raise ValueError('Invalid    endogenous    array;    must    be    ordered    in    contiguous    memory.')
    if (not endog.flags['F_CONTIGUOUS']):
        endog = np.asfortranarray(endog)
    self._complex_endog = np.iscomplexobj(endog)
    self.endog = endog
    self.nobs = self.endog.shape[1]
    if hasattr(self, 'shapes'):
        self.shapes['obs'] = self.endog.shape
