def drop_columns(df_objs, drop_list): for col in drop_list: for obj in df_objs: obj = df.drop(util.get_aname2rname(col),axis=1) return df_objs
def label_to_csv(df, label_file): label_mat = df[util.get_aname2rname('EXP')].as_matrix() np.savetxt(label_file, label_mat, delimiter=',') df = df.drop(util.get_aname2rname('EXP'),axis=1) return df, label_mat
def label_to_csv(df, label_file): label_mat = df[util.get_aname2rname("EXP")].as_matrix() np.savetxt(label_file, label_mat, delimiter=",") df = df.drop(util.get_aname2rname("EXP"), axis=1) return df, label_mat
def drop_columns(df, drop_list): for col in drop_list: print 'dropping column:%r' % col df = df.drop(util.get_aname2rname(col),axis=1) print df.columns return df