def __init__(self): sname_to_pos_file = MDATA_ROOT + 'HA Submissions-Grid view.csv' self.ha_names_to_pos = { tkns[0]: (tkns[8], tkns[14]) for tkns in parse_csv(sname_to_pos_file, assert_len=15) if len(tkns[14]) == 3 } assert len(self.ha_names_to_pos) > 0
def __init__(self): self.conv_tbl = { tkns[5]: (tkns[0], (tkns[1], tkns[2])) for tkns in parse_csv(MDATA_ROOT + 'PN1_GCSD17/Conversion Tables-Table 1.csv') } self.mdata_tbl = { tkns[0]: [ ('city', 'London'), ('setting', tkns[31]), ('project', 'CSD17'), ('latitude', tkns[26]), ('longitude', tkns[27]), ('surface_material', tkns[37]), ('surface', tkns[33]), ('elevation', tkns[32]), ] for tkns in parse_csv(MDATA_ROOT + 'PN1_GCSD17/Metadata-Table 1.csv') }
def __init__(self): self.bc_to_meta = {} for tkns in parse_csv(MDATA_ROOT + 'cleaned_simplified_metadata.csv'): try: bc = tkns[1] mdata = [tkns[0]] + tkns[2:] # baltimore,235161834,other,handrail,urban,under_ground,,39.289523,-76.613904 mdata = { 'city': mdata[0], 'surface_material': mdata[1], 'surface': mdata[2], 'setting': mdata[3], 'elevation': mdata[4], 'traffic': mdata[5], 'latitude': mdata[6], 'longitude': mdata[7], } self.bc_to_meta[bc] = mdata except IndexError: pass assert len(self.bc_to_meta) > 0
def __init__(self): self.data = list(parse_csv("%s/world_bank/%s" % (project_path(), "hdi.csv"), ",", "'")) self.header = map(self.__normalize__, self.data[0]) self.country_data = {} self.country_rank = {}
def __init__(self): pos_to_bc_file = MDATA_ROOT + 'CSD2017_DAVID.csv' self.pos_to_bc = {(tkns[2], tkns[3]): tkns[4] for tkns in parse_csv(pos_to_bc_file)} assert len(self.pos_to_bc) > 0
def __init__(self): self.tbl = { tkns[2]: tkns[3] for tkns in parse_csv(MDATA_ROOT + 'filenames_HCY5HCCXY.tsv', sep='\t') }