(self, index)
return col
Return a vector - as a view, not a copy - with a column of the table,
        and a bool flag telling whether this column is sparse. Note that
        vertical slicing of sparse matrices is inefficient.

        :param index: the index of the column
        :type index: int, str or Orange.data.Variable
        :return: (one-dimensional numpy array, sparse)
Return a vector - as a view, not a copy - with a column of the table,
        and a bool flag telling whether this column is sparse. Note that
        vertical slicing of sparse matrices is inefficient.
Return a vector - as a view not a copy - with a column of the table and a bool flag telling whether this column is sparse . Note that vertical slicing of sparse matrices is inefficient .
def get_column_view(self, index):
        """
        Return a vector - as a view, not a copy - with a column of the table,
        and a bool flag telling whether this column is sparse. Note that
        vertical slicing of sparse matrices is inefficient.

        :param index: the index of the column
        :type index: int, str or Orange.data.Variable
        :return: (one-dimensional numpy array, sparse)
        """

        def rx(M):
            if sp.issparse(M):
                return np.asarray(M.todense())[:, 0], True
            else:
                return M, False

        if isinstance(index, Integral):
            col_index = index
        else:
            col_index = self.domain.index(index)
        if col_index >= 0:
            if col_index < self.X.shape[1]:
                col = rx(self.X[:, col_index])
            elif self._Y.ndim == 1 and col_index == self._X.shape[1]:
                col = rx(self._Y)
            else:
                col = rx(self._Y[:, col_index - self.X.shape[1]])
        else:
            col = rx(self.metas[:, -1 - col_index])

        if isinstance(index, DiscreteVariable) \
                and index.values != self.domain[col_index].values:
            col = index.get_mapper_from(self.domain[col_index])(col[0]), col[1]
            col[0].flags.writeable = False
        return col
def get_column_view ( self , index ) : def rx ( M ) : if sp . issparse ( M ) : return np . asarray ( M . todense ( ) ) [ : , 0 ] , True else : return M , False if isinstance ( index , Integral ) : col_index = index else : col_index = self . domain . index ( index ) if col_index >= 0 : if col_index < self . X . shape [ 1 ] : col = rx ( self . X [ : , col_index ] ) elif self . _Y . ndim == 1 and col_index == self . _X . shape [ 1 ] : col = rx ( self . _Y ) else : col = rx ( self . _Y [ : , col_index - self . X . shape [ 1 ] ] ) else : col = rx ( self . metas [ : , - 1 - col_index ] ) if isinstance ( index , DiscreteVariable ) and index . values != self . domain [ col_index ] . values : col = index . get_mapper_from ( self . domain [ col_index ] ) ( col [ 0 ] ) , col [ 1 ] col [ 0 ] . flags . writeable = False return col