def _subset_table(full_table, subset):
if not subset:<EOL><INDENT>return full_table<EOL><DEDENT>conditions = subset.replace('<STR_LIT:U+0020>','<STR_LIT>').split('<STR_LIT:;>')<EOL>valid = np.ones(len(full_table), dtype=bool)<EOL>for condition in conditions:<EOL><INDENT>col = re.split("<STR_LIT>", condition)[<NUM_LIT:0>]<EOL>comp = condition.replace(col, "<STR_LIT>")<EOL>try:<EOL><INDENT>this_valid = eval("<STR_LIT>".format(col, comp))<EOL><DEDENT>except KeyError as e: <EOL><INDENT>raise KeyError("<STR_LIT>" % e.message)<EOL><DEDENT>valid = np.logical_and(valid, this_valid)<EOL><DEDENT>return full_table[valid]<EOL>
Return subtable matching all conditions in subset

Parameters
----------
full_table : dataframe
    Entire data table
subset : str
    String describing subset of data to use for analysis

Returns
-------
dataframe
    Subtable with records from table meeting requirements in subset