(self, table, row_index)
Construct a data instance representing the given row of the table.
Construct a data instance representing the given row of the table.
Construct a data instance representing the given row of the table .
def __init__(self, table, row_index):
        """
        Construct a data instance representing the given row of the table.
        """
        self.table = table
        self._domain = table.domain
        self.row_index = row_index
        self.id = table.ids[row_index]
        self._x = table.X[row_index]
        if sp.issparse(self._x):
            self.sparse_x = sp.csr_matrix(self._x)
            self._x = np.asarray(self._x.todense())[0]
        self._y = table._Y[row_index]
        if sp.issparse(self._y):
            self.sparse_y = sp.csr_matrix(self._y)
            self._y = np.asarray(self._y.todense())[0]
        self._y = np.atleast_1d(self._y)
        self._metas = table.metas[row_index]
        if sp.issparse(self._metas):
            self.sparse_metas = sp.csr_matrix(self._metas)
            self._metas = np.asarray(self._metas.todense())[0]
def __init__ ( self , table , row_index ) : self . table = table self . _domain = table . domain self . row_index = row_index self . id = table . ids [ row_index ] self . _x = table . X [ row_index ] if sp . issparse ( self . _x ) : self . sparse_x = sp . csr_matrix ( self . _x ) self . _x = np . asarray ( self . _x . todense ( ) ) [ 0 ] self . _y = table . _Y [ row_index ] if sp . issparse ( self . _y ) : self . sparse_y = sp . csr_matrix ( self . _y ) self . _y = np . asarray ( self . _y . todense ( ) ) [ 0 ] self . _y = np . atleast_1d ( self . _y ) self . _metas = table . metas [ row_index ] if sp . issparse ( self . _metas ) : self . sparse_metas = sp . csr_matrix ( self . _metas ) self . _metas = np . asarray ( self . _metas . todense ( ) ) [ 0 ]