def create_annotated_table(data, selected_indices):
 if (data is None):
  return None
 names = [var.name for var in (data.domain.variables + data.domain.metas)]
 name = _get_next_name(names, ANNOTATED_DATA_FEATURE_NAME)
 metas = (data.domain.metas + (DiscreteVariable(name, ('No', 'Yes')),))
 domain = Domain(data.domain.attributes, data.domain.class_vars, metas)
 annotated = np.zeros((len(data), 1))
 if (selected_indices is not None):
  annotated[selected_indices] = 1
 table = Table(domain, data.X, data.Y, metas=np.hstack((data.metas, annotated)))
 table.attributes = data.attributes
 return table

def create_annotated_table ( data , selected_indices ) : if ( data is None ) : return None names = [ var . name for var in ( data . domain . variables + data . domain . metas ) ] name = _get_next_name ( names , ANNOTATED_DATA_FEATURE_NAME ) metas = ( data . domain . metas + ( DiscreteVariable ( name , ( 'No' , 'Yes' ) ) , ) ) domain = Domain ( data . domain . attributes , data . domain . class_vars , metas ) annotated = np . zeros ( ( len ( data ) , 1 ) ) if ( selected_indices is not None ) : annotated [ selected_indices ] = 1 table = Table ( domain , data . X , data . Y , metas = np . hstack ( ( data . metas , annotated ) ) ) table . attributes = data . attributes return table
returns data with concatenated flag column .