(data, var, mask)
return col
Return an iterotor over keys for rows of the table.
Return an iterotor over keys for rows of the table.
Return an iterotor over keys for rows of the table .
def _values(data, var, mask):
        """Return an iterotor over keys for rows of the table."""
        if var == INDEX:
            return np.arange(len(data))
        if var == INSTANCEID:
            return np.fromiter(
                (inst.id for inst in data), count=len(data), dtype=int)
        col = data.get_column_view(var)[0]
        if var.is_primitive():
            col = col.astype(float, copy=False)
            nans = np.isnan(col)
            mask *= ~nans
            if var.is_discrete:
                col = col.astype(int)
                col[nans] = len(var.values)
                col = np.array(var.values + (np.nan, ))[col]
        else:
            col = col.copy()
            defined = col.astype(bool)
            mask *= defined
            col[~mask] = np.nan
        return col
def _values ( data , var , mask ) : if var == INDEX : return np . arange ( len ( data ) ) if var == INSTANCEID : return np . fromiter ( ( inst . id for inst in data ) , count = len ( data ) , dtype = int ) col = data . get_column_view ( var ) [ 0 ] if var . is_primitive ( ) : col = col . astype ( float , copy = False ) nans = np . isnan ( col ) mask *= ~ nans if var . is_discrete : col = col . astype ( int ) col [ nans ] = len ( var . values ) col = np . array ( var . values + ( np . nan , ) ) [ col ] else : col = col . copy ( ) defined = col . astype ( bool ) mask *= defined col [ ~ mask ] = np . nan return col