def disassemble(data): output = io() offset = 0 while offset < len(data): s = disassemble_one(data, offset) if s: output.write(s + "\n") offset += 8 return output.getvalue()
def get_data(query, sql_source): '''submits a query to queryCartoDB and returns a pandas dataframe Arguments: query - string: a valid sql query string source - a valid sql api endpoint OPTIONAL (e.g. fb55 account) ''' try: return pd.read_csv(io(queryCartoDB(query, source=sql_source)), sep = ',') except ValueError as v: print (str(v))
def _string2Dataframe(data): sb = io(data) dataFrame = pd.read_csv(sb, sep=' ', names=('d', 'amp')).sort('d') return dataFrame
def assemble(source): insts = parse(source) output = io() for inst in insts: output.write(assemble_one(inst)) return output.getvalue()